RE: Smarty 2.0 Prefilter
| From: | WiL Laxa | Date: | Fri, 01 Mar 2002 01:06:44 +0000 |
| Subject: | RE: Smarty 2.0 Prefilter | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2901@lists.php.net to get a copy of this message | ||
I've placed the code in the plugins directory as prefilter.capture.php and
now I'm trying to access it using this code:
$template->register_prefilter('capture');
$body = $template->fetch('_admin/users/templates/user_login.htm');
but the $body is still the same as if the prefilter wasn't registered.
WiL
-----Original Message-----
From: Monte Ohrt [mailto:monte@ispi.net]
Sent: Thursday, February 28, 2002 4:32 PM
To: smarty@lists.ispi.net
Subject: [smarty] RE: Smarty 2.0 Prefilter
If you're using the 2.0 prototype, they go in the plugins directory.
> -----Original Message-----
> From: WiL Laxa [mailto:wlaxa@blendermedia.com]
> Sent: Thursday, February 28, 2002 5:57 PM
> To: smarty@lists.ispi.net
> Subject: [smarty] Smarty 2.0 Prefilter
>
>
> Since there is no Smarty.addons.php file where do you place a template
> prefilter.
>
> <?php
>
> /*
> * Smarty plugin
> * -------------------------------------------------------------
> * Type: prefilter
> * Name: capture
> * Purpose: capture data between the the <!--capture--> tags
> * -------------------------------------------------------------
> */
>
> function capture($tpl_source) {
> eregi('<!--capture-->(.*)<!--/capture-->',$tpl_source,$match);
> return $match[1];
> }
>
> ?>
>
>
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
---
You are currently subscribed to smarty as: wlaxa@blendermedia.com
To unsubscribe send a blank email to $subst('Email.Unsub')
Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/