Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Cant get smarty values in javascript

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
noobie-php
Smarty n00b


Joined: 23 Nov 2011
Posts: 4

PostPosted: Tue Nov 29, 2011 11:23 am    Post subject: Cant get smarty values in javascript Reply with quote

ok here is the snippet of my code i cant get values like POST type or Request Type in my smarty code.
alert("{$smarty.request.phone}");
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7367
Location: Lincoln Nebraska, USA

PostPosted: Tue Nov 29, 2011 2:49 pm    Post subject: Reply with quote

it should work, can we see the HTML browser source that is rendered? Also, is there a value in PHP for $_REQUEST['phone'] ?
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Nov 29, 2011 3:37 pm    Post subject: Reply with quote

It looks like that 'alert("{$smarty.request.phone}");' is located in the PHP script. at PHP script level you can't access a template variable like {$smarty.request.phone}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development 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