Re: [SMARTY] More newbie questions

From: Date: Tue, 27 Jan 2004 16:35:20 +0000
Subject: Re: [SMARTY] More newbie questions
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10879@lists.php.net to get a copy of this message
Robin Kopetzky wrote:
example 1) <TD><?php echo SomeFunction($blah, $foo, $bar); ?><TD> or example 2) <?php require "some_file.php"; ?> Do I use {php}blah-blah{/php) on the first example and {include file="some_file.php") on the second or is there a better way?
the proper way would be to assign the output of SomeFunction() to a variable and pass that to smarty.
The documentation says nothing about calling user-defined functions in Smarty.
this isn't entirely true: either you want to completely create your output with SomeFunction() - in this case you don't have to call your function in the template at all, but assign the output to a smarty variable - /or/ you want to process the output in the template. this is done using a plugin (see http://smarty.php.net/manual/en/plugins.php). cheers mb -- Omnipotence, n.: host:/#

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