예제 #1
0
 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));
     }
 }