Required Field "*" Placement

Hi,

Can some one tell me how to place "*" sign before the label

Please refer the image if i am not clear.

This is the code that gives "*" after label "Password"




        <div class="row">

		<?php echo $form->labelEx($model,'password'); ?>

		<?php echo $form->passwordField($model,'password'); ?>

		<?php echo $form->error($model,'password'); ?>

	</div>



http://www.yiiframework.com/wiki/56/#hh0

make needed field required

You can optionally set $htmlOptions[‘required’] = true for activeLabel (activeLabelEx will overwrite it).

this is what you need


<?php


CHtml::$beforeRequiredLabel = ' <span class="required">*</span>';

CHtml::$afterRequiredLabel = '';


?>