Re: [SMARTY] Newbee Question about how smarty works

From: Date: Mon, 10 Nov 2003 02:14:17 +0000
Subject: Re: [SMARTY] Newbee Question about how smarty works
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10513@lists.php.net to get a copy of this message
On Sun, 2003-11-09 at 21:03, Mark Dyer wrote: > Hello, > I'm a newbee with Smarty but really wanting to get into this. > > Inside my template I would like to show different templates depending on if > they have logged into the site or not. > I have a question and looking for some example code. I'm not if I should > which way I am meant to use smarty > > 1 > > Do I check if the user is logged in from my index.php file than call the > related template ie loginbox or user logged in links and save this output to > a var. > Once I have processed all the above information do I than call the main > index.tpl and pass the vars calcuated above. > > > or 2 > Call the template. Have an if (userlogged()) statment in the template which > calls another template from inside the template. Two ways to do this that I can think of (maybe more). One is to use a smarty {if} statement in the template, the other is to dynamically expand a one or another template inside a master template. take your pick :) Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.smarty.general (#10513) next »