appending an element to an array in the template

View: New views
1 Messages — Rating Filter:   Alert me  

appending an element to an array in the template

by antonM :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i want to append an element to an array in the template. for example, i've assigned a smarty variable as shown below:

$colors = array('red', 'blue', 'yellow');
$smarty->assign('colors', $colors);

in the template, i want to append another element to the colors array. how can i do that? below is an imaginary code i've made:

{append var=colors value='white'}

i think i can work this out by making a plugin but is there already a built in function in doing this?