コード例 #1
0
ファイル: MotherController.php プロジェクト: ramosisw/domotic
 /**
  * Finds the Mother model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Mother the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Mother::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #2
0
ファイル: _form.php プロジェクト: ramosisw/domotic
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">
コード例 #3
0
ファイル: Funcionalidad.php プロジェクト: ramosisw/domotic
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdMother()
 {
     return $this->hasOne(Mother::className(), ['id' => 'id_mother']);
 }
コード例 #4
0
ファイル: SiteController.php プロジェクト: ramosisw/domotic
 public function actionIndex()
 {
     $model = Mother::find()->all();
     return $this->render('index', ['model' => $model]);
 }