Re: [SMARTY] What's wrong?
| From: | messju mohr | Date: | Mon, 18 Aug 2003 09:52:11 +0000 |
| Subject: | Re: [SMARTY] What's wrong? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10085@lists.php.net to get a copy of this message | ||
On Sat, Aug 16, 2003 at 08:11:49PM +0200, Nino Katic wrote:
> Hi,
>
> This is working fine in Smarty 2.4.2, but not in 2.5.0
>
> {section name=bjez loop=$smarty.session.svijezici}
>
> {$smarty.session.svijezicikratki[bjez]}
>
> {/section}
>
> Is says:
>
> Fatal error: Smarty: [in
> file:c:/Project/templates/test/generalinsert.tpl line 104]: syntax
> error: $smarty.session.svijezicikratki is an invalid reference
> (Smarty_Compiler.class.php, line 1693) in
> c:\Projekti\Smarty-2.5.0\libs\Smarty_Compiler.class.php on line 1824
this is a limitation of the $smarty-special-var. it doesn't allow more
complex dereferencing than the "." after $smarty.* . i was always
unsure if this restriction is good (to disencourage people using
get/post/cookie/session directly instead of piping it through their
business-logic and assinging it to a "normal" template-variable) or if
it is a bug.
i recently decided, although accessing session-vars directly from the
template is not nice, making it an invalid reference it is a bug and
committed a fix.
greetings
messju
> I can't figure what's wrong?
>
> Regards,
>
> Nino