/** * Finds the BudgetTier model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return BudgetTier the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = BudgetTier::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
<?php use yii\helpers\Html; use yii\widgets\DetailView; use app\models\BudgetTier; use scotthuangzl\googlechart\GoogleChart; /* @var $this yii\web\View */ /* @var $model app\models\Lead */ $this->title = $model->name; $this->params['breadcrumbs'][] = ['label' => 'Leads', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; $budgetsize = BudgetTier::findOne(['level' => $model->budget_tier]); ?> <div class="lead-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <h4> <?php echo Html::encode($model->title); ?> </h4> <table> <tr> <td> <?php echo Html::img($model->picture, ['width' => '350', 'height' => '350'], ['alt' => $model->name]); ?> </td>