Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Assign smarty variable to php code in tpl file

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
ramesht
Smarty n00b


Joined: 18 Sep 2010
Posts: 1

PostPosted: Sat Sep 18, 2010 6:08 am    Post subject: Assign smarty variable to php code in tpl file Reply with quote

Hi,

How can i assign smarty variable to php code in tpl file ?


Code:

{$destination_values.id}

{php }
$valdum = $this->get_template_vars('destination_values.id');
{/php}


Thanks
Back to top
View user's profile Send private message
elpmis
Smarty Elite


Joined: 07 Jun 2007
Posts: 321

PostPosted: Sat Sep 18, 2010 8:49 am    Post subject: Reply with quote

You can access to Smarty from PHP

http://www.smarty.net/manual/en/api.get.template.vars.php

But if I'm right the use of {php} {/php} must be activated separately

http://www.smarty.net/manual/en/language.function.php.php
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP