| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace app\controllers;
- use yii\filters\AccessControl;
- use yii\web\Controller;
- use yii\filters\VerbFilter;
- class SiteController extends Controller {
- /**
- * {@inheritdoc}
- */
- public function behaviors() {
- return [
- 'access' => [
- 'class' => AccessControl::className(),
- 'only' => ['asignar-descarga', 'index', 'consulta', 'logout'],
- 'rules' => [
- [
- 'actions' => ['asignar-descarga', 'index', 'consulta', 'logout'],
- 'allow' => true,
- 'roles' => ['@'],
- ],
- ],
- ],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function actions() {
- return [
- 'error' => [
- 'class' => 'yii\web\ErrorAction',
- ],
- 'captcha' => [
- 'class' => 'yii\captcha\CaptchaAction',
- 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
- ],
- ];
- }
- public function actionLogout() {
- \Yii::$app->getUser()->logout();
- return $this->redirect("/");
- }
- /**
- * Displays homepage.
- *
- * @return string
- */
- public function actionIndex() {
- return $this->redirect('inicio');
- }
- public function actionAsignarDescarga() {
- return $this->render('asignar-descarga');
- }
- public function actionConsulta() {
- return $this->render('consulta');
- }
- }
|