|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
rishee97 Smarty n00b
Joined: 10 Jul 2017 Posts: 1
|
Posted: Mon Jul 10, 2017 3:20 pm Post subject: Smarty session array inside Javascript |
|
|
PHP:
$t_ap=$quantity[$i]*$sp;
$_SESSION["t_ap"]=$t_ap;
The above code is php code for storing t_ap in session for using it in tpl file.
When in try print_r($_SESSION["t_ap"]); the output is 2000 4000 200.
But when i use it inside tpl file the output is only 200;
TPL:(inside javascript)
var arr1 = {$smarty.session.t_ap|json_encode};
When i print array the value is 200
All i want is to receive values of $t_ap in javascript and to create a table with it.
Please help me with this. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon Jul 10, 2017 6:33 pm Post subject: |
|
|
Check the actual HTML (ok, JS) generated by your template. |
|
Back to top |
|
|
|
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
|