RE : [SMARTY] Newbee Question about how smarty works
| From: | Alain Fontaine | Date: | Mon, 10 Nov 2003 15:09:53 +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-10514@lists.php.net to get a copy of this message | ||
Hello,
There are a couple of aspects that might help you decide which way to go. An
important one is, as far as I am concerned, the complexity or load
associated with the "user personsalization" of the site. If you need to load
a lot of data from a database, and do complex calculations, for a
"logged-in-user" version of the site, it might be a bad thing to do all
these calculations and then -not- to display them in your template...
Alain
---
Alain Fontaine
Director
VAlain S.A.
27 rue Knupp
L-9535 Wiltz
Luxembourg
www.valain.lu
-----Message d'origine-----
De : Mark Dyer [mailto:mark@webbiznz.co.nz]
Envoyé : lundi 10 novembre 2003 03:04
À : smarty-general@lists.php.net
Objet : [SMARTY] Newbee Question about how smarty works
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.
If anyone has some great resouces they recommend it'll be really apperiated.
Regards
Mark Dyer
MSN: support@webbiznz.net.nz
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php