Re: [SMARTY-DEV] default modifier
[email protected] ("messju mohr") Sun, 5 Feb 2006 10:57:52 +0100
| Newsgroups | php.smarty.dev |
|---|---|
| Message-ID | <20060205095751.GA15272@dune> |
make your error handler handle the @-error-control operator, just
check for $errno == 0 inside it.
greetings
messju
On Sun, Feb 05, 2006 at 07:15:53AM +0100, Danilo Buerger wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Hello,
>
> when using the default modifier (for example {$whatever|default:'foo'})
> you will get a E_NOTICE (or was it E_USER_NOTICE? - i know this is
> suppressed by smartys error_reporting setting, but that doesn't work
> when using a custom error handler) because of the following code (this
> is from a compiled template):
>
> <?php echo ((is_array($_tmp=@$this->_tpl_vars['whatever'])) ?
> $this->_run_mod_handler('default', true, $_tmp, 'foo') :
> smarty_modifier_default($_tmp, 'foo')); ?>
>
> This is alright because this is how a modifier works. However to avoid a
> E_NOTICE why not just implement the default modifier just like {if
> isset($whatever)}$whatever{else}foo{/if} would work? Or maybe change the
> way modifiers are compiled by including an isset?
>
> Best Regards,
>
> Danilo Buerger
>
> PS: This is on PHP 5.1.2.
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFD5ZgZtyx3EHt/UjARAl7NAJ44M7hFraBE5rBivAWk+R/+LVp5QwCfS+t8
> 2veHNmORiN+qzAeMX1Tx5z8=
> =Z69k
> -----END PGP SIGNATURE-----
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php