Ejemplo n.º 1
0
 /**
  * Lists all Faculties models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Faculties::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }
Ejemplo n.º 2
0
<div class="majors-form">
  <div class="container">
    <div class="row">
      <?php 
$form = ActiveForm::begin();
?>

      <div class="input-field col s12">
        <?php 
echo $form->field($model, 'name')->textInput(['maxlength' => true]);
?>
      </div>
      
      <div class="input-field col s12">
        <?php 
echo Html::activeDropDownList($model, 'faculty_id', ArrayHelper::map(Faculties::find()->all(), 'id', 'name'));
?>
        <?php 
echo Html::tag('label', 'Facultad');
?>
      </div>

      <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Guardar' : 'Actualizar', ['class' => $model->isNewRecord ? 'waves-effect waves-light btn red lighten-1' : 'waves-effect waves-light btn red lighten-1']);
?>
      </div>

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