|
Re: [SMARTY] Smarty and Superglobals: msg#00439php.smarty.general
Absolutely. One of the nice things about smarty is the ability to get session information from within the template. It is a beautiful tool for dealing with shopping carts... {foreach from=$smarty.session.cart.item item=i} {$i.qty} - {$i.description} ${i.price} {/foreach} Is a quick way to output the cart contents.... You can find the other request vars in the manual: http://smarty.php.net/manual/en/language.variables.smarty.request.php On Wednesday 29 January 2003 22:21, m guckeyson wrote: > Is there a best practice for dealing with superglobals ( $_SESSION, > $_SERVER, etc) from Smarty templates? I had assumed they would be available > to the template without having to explicitly assign them, but that doesn't > seem to be the case. So, while pondering why that would be, I began to > wonder if I was missing some glaringly obvious reason to not pass them > along, implicitly or otherwise. > > $smarty->assign( '_SESSION' , $_SESSION ) at the top of every page is > growing tedious... but I'm always willing to hear a better implementation.. -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [SMARTY] Smarty and Superglobals: 00439, paul |
|---|---|
| Next by Date: | Re: [SMARTY] replacing tags: 00439, M Mohr |
| Previous by Thread: | Re: [SMARTY] Smarty and Superglobalsi: 00439, paul |
| Next by Thread: | [SMARTY] Why won't this work?: 00439, philippe . morange |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |