use kartik\widgets\SwitchInput; use frontend\models\Portones; /* @var $this yii\web\View */ /* @var $searchModel frontend\models\PortonesSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Elegir Portón'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="portones-index"> <div class="jumbotron"> <h2> <?php if (\Yii::$app->session->get('porton')) { echo 'Activado: ' . \Yii::$app->session->get('porton'); $cartel = Portones::findOne(\Yii::$app->session->get('porton'))->descripcion; } else { echo 'No ha elegido ningún portón para continuar operando'; $cartel = ''; } ?> </h2> <p class="lead"><?php echo $cartel; ?> </p> </div> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <hr/>
/** * Finds the Portones model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Portones the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Portones::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }