Yii Framework- Creating hidden field

In Yii framework we can create a hidden field using model and without model as described below

1. Creating hidden field without model.

echo CHtml::hiddenField('name' , 'value', array('id' => 'name'));

2. Creating hidden field with model.

echo $form->hiddenField($model, 'name');

Leave a Reply

Your email address will not be published. Required fields are marked *