Re: [SMARTY-DEV] Re: 'default'-modifier causes a php-notice
| From: | Monte Ohrt | Date: | Sat, 15 Mar 2003 20:15:16 +0000 |
| Subject: | Re: [SMARTY-DEV] Re: 'default'-modifier causes a php-notice | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-962@lists.php.net to get a copy of this message | ||
That is what it does. In the case the compiled template is this:
<?php echo $this->_tpl_var['foo']; ?>
Smarty will do this (after the last patch):
<?php echo @$this->_tpl_var['foo']; ?>
The potential downside to this is that you will not be notified if you
are using an undefined template variable in your template. I think this
behavior is OK in a template engine scenario, an undefined template
variable should just print nothing with no errors. If we really want an
error message, that is something smarty should generate, not PHP. That
would also add to the runtime code, so probably not important enough to
implement.
Monte
On Sat, 2003-03-15 at 14:04, Tom Sommer wrote:
> On 15 Mar 2003 13:35:17 -0600, Monte Ohrt wrote:
>
> > That should have fixed all parameters to any modifier.
>
> > I committed another patch to fix template var notices, give it another
> > shot.
>
> You can't just disable all notices. During development of templates it is
> crusial to know if a var is undefined... it should display notices always,
> but not when @ is added... just like PHP
>
>
> --
> Tom Sommer, denmark
> www.tsn.dk - www.dreamcoder.dk
--
Monte Ohrt <monte@ispi.net>