Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Especie::find();
     // add conditions that should always apply here
     $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;
     }
     // grid filtering conditions
     $query->andFilterWhere(['idEspecie' => $this->idEspecie]);
     $query->andFilterWhere(['like', 'designacao', $this->designacao]);
     return $dataProvider;
 }
Beispiel #2
0
?>

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

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

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

    <?php 
echo $form->field($model, 'idEspecie')->dropDownList(ArrayHelper::map(Especie::find()->all(), 'idEspecie', 'designacao'), ['prompt' => 'Escolher Espécie']);
?>

    <?php 
echo $form->field($model, 'idRaca')->dropDownList(ArrayHelper::map(Raca::find()->all(), 'idRaca', 'designacao'), ['prompt' => 'Escolher Raça']);
?>

    <?php 
echo $form->field($model, 'idRebanho')->dropDownList(ArrayHelper::map(Rebanho::find()->all(), 'idRebanho', 'designacao'), ['prompt' => 'Escolher Rebanho']);
?>

    <?php 
echo $form->field($model, 'idNucleo')->dropDownList(ArrayHelper::map(Nucleo::find()->all(), 'idNucleo', 'nome'), ['prompt' => 'Escolher Núcleo']);
?>

    <div class="form-group">