|
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 |
marcel158 Smarty n00b
Joined: 22 Sep 2015 Posts: 1
|
Posted: Tue Sep 22, 2015 9:45 pm Post subject: Assign value to a template variable's index |
|
|
Hello forum members,
Is there a way to assign values to a template variable's index, like:
$smarty->assign->('myarray.index', $value); |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Sep 23, 2015 5:00 am Post subject: |
|
|
You're asking wrong question.
Prepare ENTIRE array in your application, then assign it normally. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Sep 24, 2015 7:09 pm Post subject: |
|
|
Code: | $smarty->assign('myarray', array('index' => $value);
|
But you can't append other index values. so prepare your array in PHP and then assign it. |
|
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
|