示例#1
0
use yii\helpers\ArrayHelper;
use app\models\Mother;
use app\models\Tarea;
/* @var $this yii\web\View */
/* @var $model app\models\personas */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="personas-form">

    <?php 
$form = ActiveForm::begin();
?>
	
	<?php 
echo $form->field($model, 'id_mother')->dropDownList(ArrayHelper::map(Mother::find()->all(), 'id', 'nombre'))->label('Mother');
?>

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

    <?php 
echo $form->field($model, 'orden')->textInput();
?>

	<?php 
echo $form->field($model, 'relPersonaTareas[]')->checkboxList(ArrayHelper::map(Tarea::find()->all(), 'id', 'nombre'))->label('Tareas');
?>

    <div class="form-group">
示例#2
0
 /**
  * Lists all Mother models.
  * @return mixed
  */
 public function actionIndex()
 {
     $dataProvider = new ActiveDataProvider(['query' => Mother::find()]);
     return $this->render('index', ['dataProvider' => $dataProvider]);
 }
示例#3
0
 public function actionIndex()
 {
     $model = Mother::find()->all();
     return $this->render('index', ['model' => $model]);
 }