/** * Finds the Hospital model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Hospital the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Hospital::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
<?php use yii\helpers\Html; use common\models\Hospital; /* @var $this yii\web\View */ /* @var $model common\models\EvauateScore */ $this->title = 'ระบบประเมินผล'; $this->params['breadcrumbs'][] = ['label' => 'สถานพยาบาลที่ได้รับมอบหมาย', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="evauate-score-create"> <div class="page-header" style="margin-bottom:60px;"> <h1><?php echo Html::encode($this->title); ?> <small> : <?php echo @Hospital::findOne($hospital_id)->name; ?> </small></h1> </div> <?php echo $this->render('_form', ['models' => $models, 'hospital_id' => $hospital_id, 'group_id' => $group_id, 'sumTheMust' => $sumTheMust, 'sumTheBest' => $sumTheBest]); ?> </div>