|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Mon Oct 24, 2005 1:45 am Post subject: |
|
|
Can an object method be used for the name param? e.g.
Code: | {insert name=obj->header content="Content-Type: text/html"} |
|
|
Back to top |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Mon Oct 24, 2005 5:19 pm Post subject: |
|
|
Not possible? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Oct 24, 2005 5:23 pm Post subject: |
|
|
Sure -- if you specify an object method and if the object is available at the time of the insert (eg: during a cached call):
{insert name=$obj->header() content="Content-Type: text/html"}
Note the parens and the $. |
|
Back to top |
|
stot Smarty Rookie
Joined: 13 Nov 2006 Posts: 17
|
Posted: Thu Feb 11, 2010 9:49 pm Post subject: |
|
|
is the $object->method() syntax still working for insert in the latest 2.6xxx smarty versions? Im getting an error:
Code: | Fatal error: Smarty error: [in nodeSideMenu.html line 34]: syntax error: 'insert: 'name' must be an insert function name (Smarty_Compiler.class.php, line 941) in C:\xampp\php\PEAR\Smarty\Smarty.class.php on line 1113
|
it sounds reasonable, since the documentation says, function named need to have "insert__" first.
Is there another way of non caching content?
Thanks,
stot |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|