Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

object methods and default modifier using "|"

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
sekmun
Smarty n00b


Joined: 13 Nov 2009
Posts: 3

PostPosted: Fri Nov 13, 2009 10:56 pm    Post subject: object methods and default modifier using "|" Reply with quote

Hi, I've got this kind of syntax in smarty2

php:
Code:
$Smarty->register_object('Obj', $Obj);


smarty:

Code:
{Obj->method|default:"stuff"}
or
{Obj->method|escape:"html"}


it seems this kind of chained modifier with a method's (function) output is broken?

I get this error:

Code:
Exception: Syntax Error in template "smarty2.tpl" on line n "
{Obj->method|escape:'html'}
" - Unexpected "|", expected one of: "}" in smarty3/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 263
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5067
Location: Hamburg / Germany

PostPosted: Sat Nov 14, 2009 10:39 am    Post subject: Reply with quote

Thanks for bringing this up.
The fix is in the SVN now.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP