Ejemplo n.º 1
0
 protected function findModel($id)
 {
     if (($model = Pool::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 2
0
 public function search($params)
 {
     $query = Pool::find();
     if (!isset($params['sort'])) {
         $query->orderBy(['id_pool' => SORT_DESC]);
     }
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id_pool' => $this->id_pool]);
     return $dataProvider;
 }
Ejemplo n.º 3
0
 public function getPool()
 {
     return $this->hasOne(Pool::className(), ['id_pool' => 'id_pool']);
 }
Ejemplo n.º 4
0
<?php

use yii\helpers\Html;
use common\models\Bank;
use common\models\Pool;
$this->title = 'Update Bank Pool: ' . ' ' . Bank::find()->where(["id_bank" => $model->id_bank])->one()->name . " for " . Pool::find()->where(["id_pool" => $model->id_pool])->one()->pool_id;
$this->params['breadcrumbs'][] = ['label' => 'Bank Pool', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Update';
?>
<div class="BankPool-update">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <div style="overflow:hidden" class="panel">
    <?php 
echo $this->render('_form', ['model' => $model, 'type' => $type, 'bank' => $bank]);
?>
</div>
<div style="height:20px"></div>
</div>