Re: Smarty functions and return value

From: Date: Tue, 26 Jun 2001 13:30:26 +0000
Subject: Re: Smarty functions and return value
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-983@lists.php.net to get a copy of this message
On Tue, 26 Jun 2001, Andreas Kaiser wrote: > Hi, > > a question about Smarty functions. > Is it possible to do something like this: > > function foo($params) { > extract($params); > if (!empty($test)) { > return eregi("(altavista)", $test)); > } > return 0; > } > > $smarty->register_function("bot", "foo"); > > {if bot test=$user_agent } > blafasel > {/if} No, it's not and it will not be. Smarty is not a full-featured programming language and was never intended to be so. If you really need to do this, just call your function directly: {if foo($user_agent)} .. {/if} -Andrei "I think it would be a good idea." -- Mahatma Gandhi, when asked what he thought of Western civilization...

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