Re: [SMARTY] Bug with smarty:nodefaults and arrays in sections?
| From: | messju mohr | Date: | Thu, 03 Jul 2003 11:15:14 +0000 |
| Subject: | Re: [SMARTY] Bug with smarty:nodefaults and arrays in sections? | ||
| References: | 1 2 3 4 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9822@lists.php.net to get a copy of this message | ||
Smarty version 2.5.0 with strip_tags as default_modifier:
{assign var=r2 value=$urls[inhalt1]|smarty:nodefaults|upper}
->
<?php echo $this->_plugins['function']['assign'][0](array('var'
=> 'r2','value' => $this->_run_mod_handler('upper', true,
$this->_tpl_vars['urls'][$this->_sections['inhalt1']['index']])),
$this) ; ?>
(note: no strip_tags, but upper modififier applied)
where
{assign var=r2 value=$urls[inhalt1]|upper}
->
<?php echo $this->_plugins['function']['assign'][0](array('var'
=> 'r2','value' => $this->_run_mod_handler('upper', true,
$this->_run_mod_handler('strip_tags', true,
$this->_tpl_vars['urls'][$this->_sections['inhalt1']['index']]))),
$this) ; ?>
(note, strip_tags and upper modififier applied)
this looks good to me.
of course strip_tags is applied if you do {$r2} for debugging. you
have to do {$r2|smarty:nodefaults} to get the original value of $r2.
again: this all works for me as expected.
On Thu, Jul 03, 2003 at 12:34:58PM +0200, Karsten Dambekalns wrote:
> Karsten Dambekalns wrote:
> >Well, it doesn't for me. Strangely, it seemed to work at first. but then
> >(doing further changes), stopped for the new code as well as the old
> >code. Any hints on how to best track this down?
>
> Ok, some further tests showed that modifiers in general do work. In case of
>
> ---- snip ----
> r2=$urls[inhalt1]|smarty:nodefaults|upper
> ---- snip ----
>
> The tags are still stripped (remeber, strip_tags is default modifier),
> but upper *is* executed on the contents. Now, what does this tell us?
>
> And smarty:nodefaults works on a single variable just a few lines before
> the section in the same template.
>
> Karsten
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php