|
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 |
djidi Smarty n00b
Joined: 12 Jan 2014 Posts: 4
|
Posted: Sun Jan 12, 2014 4:43 pm Post subject: Add values to existing array |
|
|
Hi,
I am implementing Smarty on a project and I have some difficulties with an array.
I have an array previously declared :
Code: | $smarty->assign('cms', array(
'lang' => $_lang->lang,
'siteURL' => $siteBaseURL
...
)); |
What I want is to add new values in this array.
I have tried with :
Code: | $vars = array('key' => 'value');
$smarty->append('cms', $vars); |
Values are added, but with a numeric key :
Code: | object(Smarty_Variable)[6]
public 'value' =>
array
'lang' => string 'fr' (length=2)
'siteURL' => string 'http://......'
0 =>
array
'key' => string 'value' (length=5)
public 'nocache' => boolean false
public 'scope' => int 0
|
Is there a way to add them without the numeric key (to access them like previous data) ?
Thanks. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
djidi Smarty n00b
Joined: 12 Jan 2014 Posts: 4
|
Posted: Wed Jan 15, 2014 6:39 am Post subject: |
|
|
Thanks for the answer |
|
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
|