/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Areaintrest::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, 'is_active' => $this->is_active, 'is_deleted' => $this->is_deleted, 'created_date' => $this->created_date, 'created_by' => $this->created_by, 'updated_date' => $this->updated_date, 'updated_by' => $this->updated_by]);
     $query->andFilterWhere(['like', 'area_intrest', $this->area_intrest]);
     return $dataProvider;
 }
示例#2
0
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css" rel="stylesheet" />

<script type="text/javascript"
        src="https://maps.googleapis.com/maps/api/js?sensor=true&libraries=places">
</script>
<div class="event-form">

    <span class="label label-danger">Fields marked with * are mandatory</span>
    <p></p>
    <?php 
$form = ActiveForm::begin(['options' => ['id' => 'create-event-form']]);
?>


    <?php 
echo $form->field($model, 'interest_id')->dropDownList(ArrayHelper::map(Areaintrest::find()->all(), 'id', 'area_intrest'), ['prompt' => 'Select Event Category']);
?>

    <?php 
echo $form->field($model, 'title')->textInput(['maxlength' => true]);
?>


    <?php 
echo $form->field($model, 'description')->widget(CKEditor::className(), ['options' => ['rows' => 6], 'preset' => 'basic']);
?>


    <?php 
echo $form->field($model, 'location')->textInput(['class' => 'placepicker form-control']);
?>
 /**
  * Finds the Areaintrest model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Areaintrest the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Areaintrest::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
示例#4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getInterest()
 {
     return $this->hasOne(Areaintrest::className(), ['id' => 'interest_id']);
 }