Guest User

Untitled

a guest
Apr 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. public function actionIndex() {
  2.     $model=new TbState('search');
  3.     $model->unsetAttributes();
  4.     if(isset($_GET['TbState']))
  5.         $model->attributes = $_GET['TbState'];
  6.     if(isset($_GET['countryid'])
  7.         $model->countryid = $_GET['countryid'];
  8.     $this->render('index',array(
  9.         'model'=>$model,
  10.     ));
  11. }
  12. /////////////////////////////////
  13. public function search() {
  14. // Warning: Please modify the following code to remove attributes that
  15. // should not be searched.
  16.     $criteria=new CDbCriteria;
  17.     $criteria->compare('stateid',$this->stateid);
  18.     $criteria->compare('state',$this->state,true);
  19.     $criteria->compare('countryid',$this->countryid);
  20.  
  21.     return new CActiveDataProvider($this, array(
  22.     'criteria'=>$criteria,
  23.     ));
  24. }
Add Comment
Please, Sign In to add comment