calling {$foo->bar()->bar2()} ?
| From: | Michal Frackowiak | Date: | Thu, 10 Feb 2005 13:02:42 +0000 |
| Subject: | calling {$foo->bar()->bar2()} ? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12234@lists.php.net to get a copy of this message | ||
Hi!
I am starting to use Smarty in order to re-write my web portal. So far Smarty is the answer for my problems.
Hovewer I was surprised that the Smarty compiler does not recognize the structure
$foo->bar()->bar2()
i.e. $foo->bar() returns object $foo2 and one wants to call the method bar2() on this resulting $foo2.
According to the comments in the source code (Smarty_Compiler.class.php) following structures when calling objects are supported:
$foo->bar
$foo->bar()
$foo->bar("text")
$foo->bar($foo, $bar, "text")
$foo->bar($foo, "foo")
$foo->bar->foo()
$foo->bar->foo->bar()
$foo->bar($foo->bar)
$foo->bar($foo->bar())
$foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar))
I know very little about regexp and do not feel like able to change the Smarty engine.
Would the modification involve only regexps (Smarty::_obj_call_regexp and others) or compiler core as well?
I think such modification would be great!!!
best regards
Michal