Example #1
0
 public function search($params)
 {
     $query = TipoDocumento::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'descripcion', $this->descripcion])->andFilterWhere(['like', 'abreviatura', $this->abreviatura]);
     return $dataProvider;
 }
 public function destroy($id)
 {
     $tipo = TipoDocumento::findOrFail($id);
     $tipo->delete();
     return $tipo;
 }
 /**
  * Finds the TipoDocumento model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return TipoDocumento the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = TipoDocumento::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #4
0
<div class="alumno-form">

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

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

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

    <?php 
echo $form->field($perfil, 'tipo_documento_id')->dropDownList(ArrayHelper::map(TipoDocumento::find()->orderBy('id ASC')->asArray()->all(), 'id', 'abreviatura'));
?>

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

    <?php 
echo $form->field($perfil, 'estado_documento_id')->dropDownList(ArrayHelper::map(EstadoDocumento::find()->orderBy('id ASC')->asArray()->all(), 'id', 'descripcion'), ['prompt' => '']);
?>
    
    <?php 
echo $form->field($perfil, 'sexo_id')->dropDownList(ArrayHelper::map(Sexo::find()->orderBy('id ASC')->asArray()->all(), 'id', 'descripcion'), ['prompt' => '']);
?>

    <?php 
Example #5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTipoDocumento()
 {
     return $this->hasOne(TipoDocumento::className(), ['id' => 'tipo_documento_id']);
 }