/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = ProfileForm::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'status' => $this->status, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'birth_date' => $this->birth_date, 'phone' => $this->phone, 'mobile' => $this->mobile]); $query->andFilterWhere(['like', 'username', $this->username])->andFilterWhere(['like', 'email', $this->email])->andFilterWhere(['like', 'password_hash', $this->password_hash])->andFilterWhere(['like', 'auth_key', $this->auth_key])->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])->andFilterWhere(['like', 'account_activation_token', $this->account_activation_token])->andFilterWhere(['like', 'first_name', $this->first_name])->andFilterWhere(['like', 'middle_name', $this->middle_name])->andFilterWhere(['like', 'last_name', $this->last_name])->andFilterWhere(['like', 'gender', $this->gender])->andFilterWhere(['like', 'address', $this->address])->andFilterWhere(['like', 'notes', $this->notes]); return $dataProvider; }
<?php use app\models\Options; use yii\helpers\Html; use app\models\ProfileForm; $profile = ProfileForm::find()->where(['id' => $model->teacher_id])->one(); $this->title = implode(' ', [$model->teacher->first_name, $model->teacher->middle_name, $model->teacher->last_name]); ?> <p></p> <div class="ui two column stackable grid"> <div class="four wide column"> <div class="column"> <?php echo $this->render('_card', ['model' => $model]); ?> </div> </div> <div class="nine wide column"> <div class="column"> <?php echo $this->render('_detail', ['model' => $model, 'profile' => $profile]); ?> </div> </div> <div class="three wide column"> <div class="column"> <?php echo Options::render(['scenario' => Yii::$app->controller->action->id, 'id' => $model->id]); ?> </div> </div>