Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Plan::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(['idPlan' => $this->idPlan, 'idFacultad' => $this->idFacultad]);
     $query->andFilterWhere(['like', 'nombrep', $this->nombrep]);
     return $dataProvider;
 }
Beispiel #2
0
<div class="grupo-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'idDocente')->widget(Select2::classname(), ['data' => ArrayHelper::map(Docentes::find()->all(), 'idDocente', 'nombres'), 'language' => 'en', 'options' => ['placeholder' => ''], 'pluginOptions' => ['allowClear' => true]]);
?>

      <?php 
echo $form->field($model, 'idAsignatura')->widget(Select2::classname(), ['data' => ArrayHelper::map(Asignatura::find()->all(), 'idAsignatura', 'nombrea'), 'language' => 'en', 'options' => ['placeholder' => ''], 'pluginOptions' => ['allowClear' => true]]);
?>

        <?php 
echo $form->field($model, 'idPlan')->widget(Select2::classname(), ['data' => ArrayHelper::map(Plan::find()->all(), 'idPlan', 'nombrep'), 'language' => 'en', 'options' => ['placeholder' => ''], 'pluginOptions' => ['allowClear' => true]]);
?>


    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Guardar' : 'Actualizar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>