Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $result = $this->db->query('SELECT * FROM `topics` ORDER BY `id` ASC');
     while (($item = $result->fetch_assoc()) !== null) {
         $this->view->subMenu[] = ['name' => $item['name'], 'route' => ['pizza/topic', 'topic' => $item['urlName']]];
     }
 }
Exemplo n.º 2
0
 public function __construct()
 {
     //путь до папки шаблонов
     $this->path = __DIR__ . '/../Views/orders/';
     parent::__construct();
     if (!App::isAdmin()) {
         throw new E403Exception('403. Доступ запрещен.');
     }
 }
Exemplo n.º 3
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), ['verbs' => ['class' => 'yii\\filters\\VerbFilter', 'actions' => ['delete' => ['post']]], 'access' => ['class' => 'yii\\filters\\AccessControl', 'rules' => [['allow' => true, 'verbs' => ['GET'], 'actions' => ['index', 'update'], 'roles' => ['state_view']], ['allow' => true, 'verbs' => ['POST'], 'roles' => ['state_manage']]]]]);
 }
Exemplo n.º 4
0
 public function __construct()
 {
     //путь до папки шаблонов
     $this->path = __DIR__ . '/../Views/news/';
     parent::__construct();
 }
Exemplo n.º 5
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), ['verbs' => ['class' => 'yii\\filters\\VerbFilter', 'actions' => ['delete' => ['post']]], 'access' => ['class' => 'yii\\filters\\AccessControl', 'only' => ['index', 'create', 'delete', 'act_on_behalf'], 'rules' => [['allow' => true, 'verbs' => ['GET'], 'actions' => ['index'], 'roles' => ['user_view']], ['allow' => true, 'verbs' => ['POST'], 'actions' => ['act-on-behalf'], 'roles' => ['user_act_on_behalf']], ['allow' => true, 'actions' => ['create', 'delete'], 'roles' => ['user_manage']]]]]);
 }
Exemplo n.º 6
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), ['access' => ['class' => 'yii\\filters\\AccessControl', 'rules' => [['allow' => true, 'actions' => ['export'], 'matchCallback' => function ($rule, $action) {
         return true;
     }]]]]);
 }
Exemplo n.º 7
0
 public function init()
 {
     $this->_cart = Yii::$app->cart;
     parent::init();
 }