Re: new Smarty 2.0 plugin: calendar navigation widge t
| From: | LIMBOURG Arnaud | Date: | Fri, 08 Mar 2002 08:36:34 +0000 |
| Subject: | Re: new Smarty 2.0 plugin: calendar navigation widge t | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2975@lists.php.net to get a copy of this message | ||
You might want to have a look at Janson Anders smarty objects pool manager.
I can't remember the url though ... Browse trough the archive.
It is useful when using multiple instances of smarty ;))
Arnaud.
> -----Original Message-----
> From: Monte Ohrt [mailto:monte@ispi.net]
> Sent: Friday, March 08, 2002 8:11 AM
> To: smarty@lists.ispi.net
> Cc: smarty@lists.ispi.net
> Subject: [smarty] Re: new Smarty 2.0 plugin: calendar
> navigation widget
>
>
> Excellent! I see a potential problem though; the smarty
> object is passed by
> reference into the function, and you are creating a new instance,
> overwriting the already existing one. This could have very disasterous
> results!
>
> It might be more efficient to use the existing $smarty
> object, but then you
> might run into variable assignment conflicts.
>
> so at least use a different name:
>
> $smarty_cal = new Smarty;
>
> and be sure you are using the same template directory, not
> just the default
> one out of Smarty.class.php!
>
> $smarty_cal->template_dir = $smarty->template_dir;
>
> then continue as normal:
>
> $smarty_cal->assign("url_format", $url_format);
> $smarty_cal->assign("month_name", $month_name);
> ....
>
>
> There are probably some other things I'm not thinking of, but
> this should
> help.
>
> Monte
>
>
> Michael Yoon wrote:
>
> > I just wrote a Smarty 2.0 plugin that outputs a calendar navigation
> > widget, and I thought that other people might find it
> useful. If you're
> > interested, check it out at:
> >
> > http://michael.yoon.org/software/smarty-plugins/
> >
> > One nice aspect is that the plugin has its own template and
> stylesheet,
> > so changing layout and styling is easy to do.
> >
> > Also, I'm pretty new to Smarty (a great piece of software,
> by the way),
> > so any feedback on the code itself is welcome.
> >
> > -- Michael
> >
> > ---
> > 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: arnaud.limbourg@cegetel.fr
To unsubscribe send a blank email to $subst('Email.Unsub')
Visit Smarty's homepage at http://www.phpinsider.com/php/code/Smarty/