<?php echo CHtml::dropDownList('Category', $model -> cate_id, CHtml::listData(Category::model() -> findAll(), 'id', 'name'), array('empty' => 'Select Category','submit'=>array('advert/loadAdvert','id'=>'5'))); ?>
i need to get selected dropdown list value and instead of hard coding id, i have to place that value for id.
public function actionloadAdvert($id) {
$issueDataProvider = new CActiveDataProvider('Advert', array('criteria' => array('condition' => 'cate_id=:cate_id', 'params' => array(':cate_id' => $id), ), 'pagination' => array('pageSize' => 1, ), ));
$this -> render('advertisement', array('model' => Advert::model(), 'issueDataProvider' => $issueDataProvider, ));
}
also what is the best book or resources for learning yii.