RE: Smarty 2.0 Prefilter
| From: | Monte Ohrt | Date: | Fri, 01 Mar 2002 01:10:23 +0000 |
| Subject: | RE: Smarty 2.0 Prefilter | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2902@lists.php.net to get a copy of this message | ||
You don't have to register the plugin if it is in the plugin directory. get
rid of the register_prefilter line.
name the plugin file "prefilter.capture.php" and name the plugin function
"smarty_prefilter_capture"
> -----Original Message-----
> From: WiL Laxa [mailto:wlaxa@blendermedia.com]
> Sent: Thursday, February 28, 2002 7:07 PM
> To: Monte Ohrt; smarty@lists.ispi.net
> Subject: RE: [smarty] RE: Smarty 2.0 Prefilter
>
>
> 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/
>
>