Пример #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Estudiantes::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(['codEstudiante' => $this->codEstudiante, 'fechaIngreso' => $this->fechaIngreso, 'fechaNac' => $this->fechaNac]);
     $query->andFilterWhere(['like', 'carnetEst', $this->carnetEst])->andFilterWhere(['like', 'teleDomicilio', $this->teleDomicilio])->andFilterWhere(['like', 'direccionDomicilio', $this->direccionDomicilio])->andFilterWhere(['like', 'cedula', $this->cedula])->andFilterWhere(['like', 'lugarNac', $this->lugarNac])->andFilterWhere(['like', 'nomapes', $this->nomapes]);
     return $dataProvider;
 }
Пример #2
0
use kartik\select2\Select2;
/* @var $this yii\web\View */
/* @var $model backend\models\Estudios */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="estudios-form">

  <?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>



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

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

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

    <?php 
echo $form->field($model, 'file')->fileInput();
?>

    <?php