Re: [SMARTY] Question about smarty, and if it can replace PHPLIB
| From: | Andr� Rabold | Date: | Wed, 19 Feb 2003 14:08:43 +0000 |
| Subject: | Re: [SMARTY] Question about smarty, and if it can replace PHPLIB | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7869@lists.php.net to get a copy of this message | ||
Same idea at the same time :-D
"Messju Mohr" <messju@lammfellpuschen.de> schrieb im Newsbeitrag
news:20030219140741.GH1626@pharao.lammfellpuschen.de...
> On Wed, Feb 19, 2003 at 02:54:54PM +0100, Tom Sommer wrote:
> > Currently I am building a website of PHPLIB templates, however I have
seen
> > benchmarks where smarty is much faster and PHPLIB is starting to bug me
with
> > blocks etc., so I am thinking of making a fast change to smarty...
however,
> > I have come to find the very good way of creating templates, her is how
I've
> > built them
> >
> > <html>
> > <title>{TITLE}</title>
> > <body
> > {CONTENT}
> > </body>
> > </html>
> >
> > Now, I have this in a main file called index.tpl, and on news.php I load
> > another tpl along with index.tpl (lets call it news.tpl) file, add
variables
> > to it and then redirect the final parsing of news.tpl to the variable
> > CONTENT (I also set the TITLE var in news.php) in index.tpl... and
finally
> > displaying index.tpl on news.php (with news.tpl as CONTENT)
> >
> > ....... can smarty do this?
>
> definately :)
>
> in short:
> $smarty->assign('CONTENT', $smarty->fetch('content.tpl'));
> $smarty->display('index.tpl');
>
> > Hope you understand my little config here :)
> >
> > I don't want to hear about including top and bottom headers, since I've
> > worked that way for a long time and have come to love my new way of
working
> > with templates :)
>
> there are a few drawbacks though, but you say, you don't want to hear.
>
> > Thanks for any help :)
> > --
> > Tom Sommer
> > www.tsn.dk - www.dreamcoder.dk