Re: [SMARTY] $smarty.const
| From: | Monte Ohrt | Date: | Wed, 05 Feb 2003 22:56:49 +0000 |
| Subject: | Re: [SMARTY] $smarty.const | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7539@lists.php.net to get a copy of this message | ||
Actually we can change the behavior of Smarty so if a constant is
undefined it will not throw an error, it just treats it as empty. Is
that a better way to handle constants, or is it useful to know that it
is undefined?
Monte
On Wed, 2003-02-05 at 16:47, Ferdinand Beyer wrote:
> IMO Smarty should save the return value of get_defined_constants()
> in an array and let $smarty.const.* reference to that array:
>
> $smarty.const.xyz -> $this->_constants['xyz']
>
> By doing this it would be possible to check whether a constant exists,
> eg.
>
> {$smarty.const.FOOBAR|default:'...'}
>
> --
> Ferdinand Beyer
> <fbeyer@clickhand.de>
--
Monte Ohrt <monte@ispi.net>