예제 #1
0
 public function actionBug()
 {
     //$this->layout = '//layouts/main';
     $model = new Bug();
     $dataProvider = $model->search([]);
     if (isset($_POST['Bug'])) {
         $model->attributes = $_POST['Bug'];
         $url = $model->send();
         //$this->redirect();
     }
     return $this->render('bug', array('model' => $model, 'dataProvider' => $dataProvider));
 }
예제 #2
0
파일: Bug.php 프로젝트: chaimvaid/linet3
 /**
  * Retrieves a list of models based on the current search/filter conditions.
  *
  * Typical usecase:
  * - Initialize the model fields with values from filter form.
  * - Execute this method to get CActiveDataProvider instance which will filter
  * models according to data in model fields.
  * - Pass data provider to CGridView, CListView or any similar widget.
  *
  * @return CActiveDataProvider the data provider that can return the models
  * based on the search/filter conditions.
  */
 public function search($params)
 {
     $query = Bug::find();
     $dataProvider = new \yii\data\ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'body', $this->body])->andFilterWhere(['like', 'url', $this->url]);
     return $dataProvider;
 }