RusAlex
(Pletnev Rusalex)
1
Making and dropDownList in search form.
_search.php now contain:
<?php echo $form->dropDownList($model,‘loginid’,CHtml::listData(Login::model()->findAll(), ‘id’,‘login’));?>
<?php echo $form->dropDownList($model,‘loginid’,CHtml::listData(Login::model()->findAll(), ‘id’,‘passwd’));?>
It shows 2 lists but works only last one. I want to push this lists to model together. How can i do that ?
mdomba
(Maurizio Domba Cerin)
2
Both lists set $model->loginid !!!
thinkt4nk
(Thinkt4nk)
3
You can merge the arrays for one list, but as mdomba pointed out, you’re only going to be searching loginid
shailesh
(Shailesh Makwana990)
4
<?php echo $form->dropDownList($model,‘loginid’,CHtml::listData(Login::model()->findAll(), ‘id’,‘login’));?>
<?php echo $form->dropDownList($model,‘loginid’,CHtml::listData(Login::model()->findAll(), ‘id’,‘passwd’));?>
u using The loginid ID in both so last overwrite with last thought have to keep name Seprate And define Other Name Attribute In Model
class
then work Smoothly try it…
jkofsky
(Jkofsky)
5
Try:
<?php echo $form->dropDownList($model,'loginid',CHtml::listData(Login::model()->findAll(), 'id','login'));?>
<?php echo $form->dropDownList($model,'passwd',CHtml::listData(Login::model()->findAll(), 'id','passwd'));?>
Matbe?