developer.jelix.org is not used any more and exists only for
history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.
Opened 10 years ago
Closed 10 years ago
#1231 closed bug (wontfix)
jTpl: Variable variables in template expressions produce syntax errors
Reported by: | Kirk | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | jelix:tpl | Version: | 1.1.7 |
Severity: | minor | Keywords: | jtpl |
Cc: | Blocked By: | ||
Blocking: | Documentation needed: | yes | |
Hosting Provider: | Php version: |
Description
In a template, when using a template expression like
{$foo->{$bar->baz}}
jTpl produces
<?php echo $t->_vars['foo']->{$t->_vars['bar']->baz; ?>}
instead of
<?php echo $t->_vars['foo']->{$t->_vars['bar']->baz}; ?>
causing
Parse error: syntax error, unexpected ';'
You can work around this by using
{assign $baz = $bar->baz}{$foo->$baz}
Change History (3)
comment:1 Changed 10 years ago by laurentj
- Documentation needed set
comment:2 Changed 10 years ago by laurentj
- Component changed from jelix to jelix:tpl
comment:3 Changed 10 years ago by laurentj
- Resolution set to wontfix
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
This php syntax is not supported, and won't be supported.
However, we should see if we can display a better error.
At least, the document should say it is forbidden.