Пример #1
0
 public function __construct()
 {
     parent::__construct();
     if (empty(Users::checkSess()) == true) {
         throw new MyException('E403');
     }
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     $this->flickr = new Models\Flickr('8ab106f76a997bba0c04f3772c8c0b4e');
     $this->json = new Models\Json();
     $this->image = new Models\Image();
 }
Пример #3
0
 public function beforeACtion($action)
 {
     if ($action->id === 'error') {
         $this->layout = 'main';
     }
     return parent::beforeAction($action);
 }
Пример #4
0
 public function run($route)
 {
     $controllerClass = new Controller();
     $templateClass = new Template();
     if ($this->resolveRoute($route)) {
         $controller = $this->controllerNamespace . DS . $this->controller;
         $response = call_user_func_array(array(new $controller(), $this->method), $this->params);
         if ($controllerClass->hasView == false && $response === null) {
             //run default view related to class and method
             return $controllerClass->view($this->controller . '/' . $this->method, $templateClass->getViewBag());
         }
         // elseif($response === null){
         //     throw new \Exception(sprintf('The controller %s must return a valid Response', $this->controller.'/'.$this->method));
         // }
         return $response;
     } else {
         throw new NotFoundException(sprintf('Route "%s/%s" not found', $this->controller, $this->method));
     }
 }
 public function actions()
 {
     $actions = parent::actions();
     $actions = ['password' => ['class' => 'yii\\rest\\CreateAction', 'modelClass' => $this->modelClass], 'options' => $actions['options']];
     $actions['options']['collectionOptions'] = [];
     $actions['options']['resourceOptions'] = [];
     if (Yii::$app->request->url === '/forgot/password/') {
         $actions['options']['collectionOptions'] = $this->verbs()['password'];
     }
     if (Yii::$app->request->url === '/forgot/reset/') {
         $actions['options']['collectionOptions'] = $this->verbs()['reset'];
     }
     return $actions;
 }
Пример #6
0
 public function __construct()
 {
     parent::__construct();
     $this->user = new User();
 }
Пример #7
0
 public function init()
 {
     parent::init();
 }
Пример #8
0
 public function __construct()
 {
     parent::__construct();
     $this->middleware = [];
 }
Пример #9
0
 public function __construct()
 {
     parent::__construct();
     $this->song = new Song();
 }
Пример #10
0
 function view($template = null, $params = array())
 {
     $contoller = new Controller();
     return $contoller->view($template, $params);
 }
Пример #11
0
 public function __construct()
 {
     parent::__construct();
     $this->json = new Models\Json();
 }
Пример #12
0
<?php

use app\controllers\Controller;
session_start();
require __DIR__ . '/autoload.php';
$obj = new Controller();
$obj->run();
Пример #13
0
 public function __construct()
 {
     parent::_construct();
     $this->sessionNumbersManager = new SessionNumbersManager();
 }
Пример #14
0
 public function actions()
 {
     $actions = parent::actions();
     $actions = ['index' => null, 'options' => $actions['options']];
     return $actions;
 }
Пример #15
0
 public function redirect($url, $statusCode = 200)
 {
     $url = '/' . $this->appName() . '/' . trim($url, '/');
     return parent::redirect($url, $statusCode);
 }
 public function actions()
 {
     $actions = parent::actions();
     $actions = ['index' => ['class' => '\\app\\controllers\\profile\\ViewAction', 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess']], 'update' => ['class' => '\\app\\controllers\\profile\\UpdateAction', 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess'], 'scenario' => $this->updateScenario], 'password' => ['class' => '\\app\\controllers\\profile\\PasswordAction', 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess']], 'avatar' => ['class' => '\\app\\controllers\\profile\\AvatarAction', 'modelClass' => $this->avatarClass, 'checkAccess' => [$this, 'checkAccess']], 'options' => $actions['options']];
     return $actions;
 }
Пример #17
0
 public function __construct($app)
 {
     parent::__construct($app);
     $this->repo = $app['cards.repository'];
 }