Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = TableThree::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(['id' => $this->id, 't4_id' => $this->t4_id]);
     return $dataProvider;
 }
Ejemplo n.º 2
0
/* @var $model app\models\TableOne */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="table-one-form">

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

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

    <?php 
echo $form->field($model, 'three_list')->dropDownList(ArrayHelper::map(TableThree::find()->all(), 'id', 'id'), ['multiple' => true]);
?>


    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

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

</div>