/** * Finds the FilterType model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return FilterType the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = FilterType::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
<th class="text-center col-md-2"> <?php echo \Yii::t('shop', 'Delete'); ?> </th> </tr> <?php foreach ($filters as $filter) { ?> <?php if (!empty($filter)) { ?> <tr> <td> <?php echo Yii::t('shop', FilterType::findOne($filter->filter_type)->title); ?> </td> <td> <?php echo Yii::t('shop', FilterInputType::findOne($filter->input_type)->title); ?> </td> <td class="text-center"> <?php echo Html::a('', Url::toRoute(['delete-filter', 'id' => $filter->id]), ['class' => 'glyphicon glyphicon-remove text-danger btn btn-default btn-sm']); ?> </td> </tr> <?php }