Re: [SMARTY-DEV] default modifier

From: Date: Sun, 05 Feb 2006 09:57:52 +0000
Subject: Re: [SMARTY-DEV] default modifier
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2834@lists.php.net to get a copy of this message
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

« previous php.smarty.dev (#2834) next »