Re: [SMARTY] |default=''

From: Date: Tue, 11 Jun 2002 21:26:49 +0000
Subject: Re: [SMARTY] |default=''
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4791@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 11 June 2002 15:44, Pupeno wrote: > On Tuesday 11 June 2002 15:36, Pupeno wrote: > > I would like that when the default parameter is passed, that the variable > > is not used, so no error is generated, can this be posible ? I could code > > it, but I didn't check if this is posible in the way smarty works. > > Thank you. > > Checking how to do it, instead of outputing > $this->_run_mod_handler('default', true, $this->_tpl_vars['email'], > 'username@host.org') > we would have to output: > $this->_run_mod_handler('default', true, > isset($this->_tpl_vars['email']) ? > $this->_tpl_vars['email'] : '', 'username@host.org') > is that ok ? done too, in the line 1143 of Smarty_Compiler.class.php I've changed $output = "\$this->_tpl_vars['$var_name']"; for $output = "isset(\$this->_tpl_vars['$var_name']) ? \$this->_tpl_vars['$var_name'] : ''";. I've notice that below that, there are more other prints of $this->_tpl_vars, when working with arrays, when does this run (so I can work with that too) ? Thank you - -- Pupeno: pupeno@pupeno.com http://www.pupeno.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9BmsaLr8z5XzmSDQRAm76AJ9W0+O06qWgFSGgIWPGknEK1eT0UACeID+n OHssnejUjg5GiYslmvB7qKo= =ZkX6 -----END PGP SIGNATURE-----

« previous php.smarty.general (#4791) next »