Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Value of the CHtml::activeTextArea() can now be set through $htmlOptions['value']. #1446
<?php $loginForm=new LoginForm(); ?> <?php $loginForm->username='user1'; ?> <?php echo CHtml::activeTextArea($loginForm,'username',array('value'=>'user2')); ?>
This enhancement is not needed for
Right now i have to do ugly things to pass this defect:
<!-- this is a view --> <?php $oldValue=$model->value2; // i want to keep $model->value2 untouched, but in a view, when shown to the user it should be altered $model->value2=$model->value1; echo CHtml::activeTextArea($model,'value2'); $model->value2=$oldValue; ?>
With this enhancement it would look much better:
<!-- this is a view --> <?php echo CHtml::activeTextArea($model,'value2',array('value'=>$model->value1)); ?>
Not just getting the value from the model, but:
I think it's natural to allow developer to alter some of these clauses.