Re: [SMARTY] {php} and template: variables back and forth
| From: | Desiree Rivera | Date: | Fri, 17 Jan 2003 17:41:35 +0000 |
| Subject: | Re: [SMARTY] {php} and template: variables back and forth | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7256@lists.php.net to get a copy of this message | ||
Hi,
I found something in the documentation and it works for me. :)
Try:
- - - - - - - toto.tpl - - - - - - -
{php}
$this->assign("toto","I'm a cute little doggie");
{/php}
The var is {$toto}
- - - - - - - - - - - - - - - - - - - -
Here's a link that might help as well: http://smarty.php.net/manual/en/tips.componentized.templates.php
At 09:54 AM 1/17/2003 +0100, philippe.morange@ca-indosuez.com wrote:
Hi,
The title says most of what I need to do.
Inside a template, I have to use {php} ... {/php} tags.
But I noticed that variables from the template that are above {php} are not accessible within the
tags, and variables I set and assign between {php} tags are not accessible after that in the
template.
I'd like to be able to assign some variables in {php}...{/php}, right inside a template, and use
those new variables afterwards in the template...
Kind of like so:
- - - - - - - toto.tpl - - - - - - -
...smarty stuff...
{php}
...php stuff...
$smarty->assign('toto', $toto);
{/php}
...more smarty stuff...
The var is {$toto}
- - - - - - - - - - - - - - - - - - - -
Thanks for your help,
Philippe.
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php