Re: store templates files in SQL
| From: | Brian Andrews - InforMate | Date: | Wed, 17 Oct 2001 02:52:20 +0000 |
| Subject: | Re: store templates files in SQL | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1708@lists.php.net to get a copy of this message | ||
I hate having files stored all over the place, in multiple
directories etc so I have all my templates in a db. Works
real well - all you need is a field for modified date,
(or timestamp) and update it when you save template changes to
the db. In your db resource function just make sure
you set the $tpl_source and $tpl_timestamp values eg:
$tpl_source=$db->f("template_source");
$tpl_timestamp=$db->f("mdate");
kinda thing....
-
brian
> -----Original Message-----
> From: Bob [mailto:whyisityou2@yahoo.com]
> Sent: Wednesday, 17 October 2001 3:36 p.m.
> To: smarty@lists.ispi.net
> Cc: smarty@lists.ispi.net
> Subject: [smarty] Re: store templates files in SQL
>
>
> What would the advantage be in having the template in a database?
> How would you
> know if the template has been changed cuz there's no timestamp on
> a file, right?
>
>
>
>
> Bertrand DUNOGIER wrote:
>
> > Hello,
> >
> > Uh ho, ok. Didn't read the doc... RTFM me bitch :)
> >
> > Bertrand (aka Katana on EFNet :p)
> >
> > MO> You can use your own resource handler, documented in the manual.
> >
> > MO> Sheldon Jones - Admin wrote:
> > >>
> > >> Does anyone know how or have a function to store the
> template files in
> > >> an SQL database.
> > >>
> > >> I've looked at the smarty code an I believe this is the function that
> > >> would have to be changed.. _read_file($resource_name)..
> > >>
> > >> Thanks in advance.
> > >>
> > >> --
> > >> --Sheldon
> > >>
> > >> ------------------------------------------------------
> > >> Sheldon Jones
> > >> Systems Administrator
> > >> Lobo Internet Services, Ltd.
> > >>
> > >> mailto:sheldon@hobbydump.com
> > >>
> > >> Does Microsoft mean "small and limp"?
> > >> What's with the 'Intel Inside' warning label anyway?
> > >> ------------------------------------------------------
> > >>
> > >> ---
> > >> 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/
> >
> > MO> --
> > MO> Monte Ohrt <monte@ispi.net>
> > MO> http://www.ispi.net/
> >
> > MO> ---
> > MO> You are currently subscribed to smarty as: bdunogier@wanadoo.fr
> > MO> To unsubscribe send a blank email to
> $subst('Email.Unsub')
> > MO> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
> >
> > ---
> > You are currently subscribed to smarty as: whyisityou2@yahoo.com
> > To unsubscribe send a blank email to $subst('Email.Unsub')
> > Visit Smarty's homepage at
> > http://www.phpinsider.com/php/code/Smarty/
>
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
> ---
> You are currently subscribed to smarty as: brian@informate.co.nz
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
>