|
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 |
pvginkel Smarty n00b
Joined: 04 Aug 2006 Posts: 3
|
Posted: Fri Aug 04, 2006 3:36 pm Post subject: {$a->b()->c()} doesn't parse (has fix) |
|
|
I'm not sure if this is a bug or a feature request because a compile error is generated on the first code block. The second block does compile though but gives an unexpected result. It should either be fixed or generate a compile error too.
This doesn't compile:
I've found this in a foreach like this, which does compile, but incorrectly:
Code: | {foreach from=$a->b()->c() item="item"}
{$item}
{/foreach} |
This generates the following compiled code for the $a->b()->c() part:
Code: | ($this->_tpl_vars['a'])."->b()->c()" |
This can be fixed by moving the following code block from Smarty_Compiler.class.php:164 to line 163, directly before the )+) part:
Code: | (?:' . $this->_obj_params_regexp . ')? |
With this change, both the first and second code blocks compile and generate the correct result. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Fri Aug 04, 2006 6:07 pm Post subject: |
|
|
Hi and thanks for posting.
This has been discussed many times and the problem is that this would not work under PHP4. As this is not a bug but rather a feature request, I am moving the thread to that forum. |
|
Back to top |
|
m-kay Smarty n00b
Joined: 23 Nov 2006 Posts: 4 Location: The Netherlands
|
Posted: Thu Dec 07, 2006 3:15 pm Post subject: |
|
|
Wow, I was looking for this! Thanks! _________________ I look back and I'm amazed, that my thoughts were so clear and true, that three words went through my mind endlessly, repeating themselves like a broken record... you're so cool, you're so cool, you're so cool... |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Dec 07, 2006 3:31 pm Post subject: |
|
|
@m-kay's signature: true romance/patricia arquette/1993 ? |
|
Back to top |
|
m-kay Smarty n00b
Joined: 23 Nov 2006 Posts: 4 Location: The Netherlands
|
Posted: Sun Dec 10, 2006 6:41 pm Post subject: |
|
|
messju wrote: | @m-kay's signature: true romance/patricia arquette/1993 ? |
Yup. _________________ I look back and I'm amazed, that my thoughts were so clear and true, that three words went through my mind endlessly, repeating themselves like a broken record... you're so cool, you're so cool, you're so cool... |
|
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
|