Пример #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
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getCodEstudiante0()
 {
     return $this->hasOne(Estudiantes::className(), ['codEstudiante' => 'codEstudiante']);
 }
Пример #3
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 
Пример #4
0
 /**
  * Finds the Estudiantes model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Estudiantes the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Estudiantes::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }