コード例 #1
0
ファイル: KidsController.php プロジェクト: noahkim/kowop
 public function actionSearch()
 {
     $this->layout = '//layouts/mainNoSearch';
     $model = new ExperienceSearchForm();
     if (isset($_REQUEST['ExperienceSearchForm'])) {
         $model->attributes = $_REQUEST['ExperienceSearchForm'];
         Yii::app()->session['lastSearch'] = $model->keywords;
     }
     $results = $model->search();
     $this->render('search', array('model' => $model, 'results' => $results));
 }
コード例 #2
0
 public function actionSearchResults()
 {
     $this->layout = false;
     $model = new ExperienceSearchForm();
     if (isset($_REQUEST['ExperienceSearchForm'])) {
         $model->attributes = $_REQUEST['ExperienceSearchForm'];
         Yii::app()->session['lastSearch'] = $model->keywords;
     }
     $results = $model->search();
     if (isset($_REQUEST['json'])) {
         echo $this->getJSONFormattedResults($results);
     } else {
         $this->render('_searchResults', array('model' => $model, 'results' => $results));
     }
 }