Re: [SMARTY] Bug or Feature
| From: | Ferdinand Beyer | Date: | Sat, 15 Feb 2003 08:36:54 +0000 |
| Subject: | Re: [SMARTY] Bug or Feature | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7778@lists.php.net to get a copy of this message | ||
On 14 Feb 2003 at 22:05, Hinrich Donner wrote:
> Thanks!
>
> > Smarty does not show the console when fetch()'ing content since it
> > didn't make much sense [...]
>
> So I should use a construction like ob_start() and $smarty->Display().
>
> Hinrich
Here is another way to do it:
(1) Change your modifyOutput() function to accept two parameters:
The template output and a reference of the Smarty object:
function mofifyOutput($tpl_output, &$smarty)
[or right a wrapper function with that API calling modifyOutput()]
(2) Register the function as a smarty output filter:
$smarty->register_outputfilter('modifyOutput');
(3) Run the Smarty::display() method like normal:
$smarty->display('index.tpl');
Now the template is executed and the content is passed to
modifyOutput() before it is displayed.
--
Ferdinand Beyer
<fbeyer@clickhand.de>