How To Give Multiple Class In Htmloptions ?

Hello Yii

      Friends

I want to give multiple class in yii htmloptions for which I have written code such as follows.

<?php echo CHtml::textField(‘username’, $username, array(‘placeholder’ => ‘Username’,array(‘class’=>‘mr-20’))); ?>

<?php echo CHtml::submitButton(‘save’, $htmlOptions = array(‘class’ => ‘control_button’)); ?>

Where now i had only insert one class i.e. control button but now i want to add other class too…so how can i do it?same in Chtml::textField and Chtml::submitButton.

Thanks in advance.

Sundar

The htmlOptions array basically takes an array of key/value pairs that are printed in the html source as-is. So, if your html source has a class attribute like this…


<input type="submit" class="control_button my-class" value="save" />

… you can use an htmlOptions array like this:


echo CHtml::submitButton('save', array('class' => 'control_button my-class'));