View previous topic :: View next topic |
Author |
Message |
caoimhin Smarty Rookie
Joined: 08 Nov 2009 Posts: 24 Location: Lebbeke, Belgium
|
Posted: Fri Jan 01, 2010 7:41 pm Post subject: Static Object Access |
|
|
What is the best solution to call a static object in smarty?
Let's say I want to use Bla::something() in my template and it outputs a string. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Jan 02, 2010 12:47 pm Post subject: |
|
|
In SMarty3 you can access static classes directly.
{Bla::something()} to output the result. |
|
Back to top |
|
caoimhin Smarty Rookie
Joined: 08 Nov 2009 Posts: 24 Location: Lebbeke, Belgium
|
Posted: Tue Jan 05, 2010 11:29 pm Post subject: |
|
|
U.Tews wrote: | In SMarty3 you can access static classes directly.
{Bla::something()} to output the result. |
The answer I was looking for, thnx ! I cannot test it right now, but does it work with namespaces too? |
|
Back to top |
|
caoimhin Smarty Rookie
Joined: 08 Nov 2009 Posts: 24 Location: Lebbeke, Belgium
|
Posted: Fri Jan 08, 2010 12:34 pm Post subject: |
|
|
caoimhin wrote: | U.Tews wrote: | In SMarty3 you can access static classes directly.
{Bla::something()} to output the result. |
The answer I was looking for, thnx ! I cannot test it right now, but does it work with namespaces too? |
I guess it's not .. |
|
Back to top |
|
caoimhin Smarty Rookie
Joined: 08 Nov 2009 Posts: 24 Location: Lebbeke, Belgium
|
Posted: Thu Jan 21, 2010 12:28 pm Post subject: |
|
|
No solution for this? |
|
Back to top |
|
caoimhin Smarty Rookie
Joined: 08 Nov 2009 Posts: 24 Location: Lebbeke, Belgium
|
Posted: Wed Mar 17, 2010 8:22 am Post subject: |
|
|
Up .. |
|
Back to top |
|
caoimhin Smarty Rookie
Joined: 08 Nov 2009 Posts: 24 Location: Lebbeke, Belgium
|
Posted: Mon Jun 21, 2010 12:26 pm Post subject: |
|
|
Guys? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Jun 21, 2010 3:31 pm Post subject: |
|
|
I don't think namespaces are supported yet. |
|
Back to top |
|
saboya Smarty Rookie
Joined: 24 Jun 2010 Posts: 6
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Jun 24, 2010 8:39 pm Post subject: |
|
|
syntax. The goal of Smarty is to speparate the design as much as possible from the business logic. With namespace syntax we would more and more of business logic into the templates.
Instead ou can register a class with optional namespace for the use in the template like:
Code: | $smarty->register->templateClass('foo','name\name2\myclass'); |
And use it in the template
This modification is in the SVN now. |
|
Back to top |
|
|