[eZ publish] How to add a element to an array.

Assumed that $old_array is an array.

{def $new_array = array()}
{
foreach $old_array as $key=>$model}
{set
$new_array = $new_array|append($model)}
{
/foreach}
Pay attention to the code: {set $new_array = $new_array|append($model)}, we have to use "set" to add the value to the array!

So wired!

posted @   DavidHHuan  阅读(288)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示