|
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 |
marsellus Smarty n00b
Joined: 06 Jun 2013 Posts: 1
|
Posted: Thu Jun 06, 2013 8:59 am Post subject: {RegObject->prop} always compiles to method access |
|
|
With smarty2 i've used this excessively:
Code: | {RegObject->property assign='var'} |
Now smarty3 always treats this as if it was a method
Code: | {RegObject->property() assign='var'} |
compiled template v2:
Code: | $this->assign('var', $this->_reg_objects['RegObject'][0]->property); |
compiled template v3:
Code: | $_smarty_tpl->assign('var',$_smarty_tpl->smarty->registered_objects['RegObject'][0]->property()); |
while v2 checked if it was a method, in Smarty_Compiler.class.php, with:
Code: | if(method_exists($this->_reg_objects[$object][0], $obj_comp)) |
v3 does not do this in smarty_internal_compile_private_object_function.php
so i worked around it using
Code: | if (method_exists($compiler->smarty->registered_objects[$tag][0], $method)) |
the price question is: was this feature drop intentional? if so, why? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Jul 27, 2013 9:50 am Post subject: |
|
|
This has been now added for Smarty2 BC in the SVN trunk and will later be included in 3.1.15 |
|
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
|