{php} and template: variables back and forth

From: Date: Fri, 17 Jan 2003 08:54:21 +0000
Subject: {php} and template: variables back and forth
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7245@lists.php.net to get a copy of this message
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.

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