Hidden array attribute

In my form I want add an hidden attribute with activeHiddenField, I need it to be an array, is it possible?

I try to define it in the model with:

public $myArray;

i tried also:

public $myArray=array();

and then in the view i write:

echo CHtml::activeHiddenField($model, 'myArray'); 

but after I set it with values for example:



in the following render of the view I have the error message:


htmlspecialchars() expects parameter 1 to be string, array given

Source File


00054: */

00055: public static $count=0;


00057: /**

00058: * Encodes special characters into HTML entities.

00059: * The {@link CApplication::charset application charset} will be used for encoding.

00060: * @param string data to be encoded

00061: * @return string the encoded data

00062: * @see http://www.php.net/manual/en/function.htmlspecialchars.php

00063: */

00064: public static function encode($text)

00065: {

00066: return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);

00067: }






i think is not possible

see http://phpprogramming.wordpress.com/2007/05/06/php-passing-array-using-hidden-form-element/



maybe help you


Thanks Horacio.