Esempio 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']]];
     }
 }
Esempio n. 2
0
 public function __construct()
 {
     //путь до папки шаблонов
     $this->path = __DIR__ . '/../Views/orders/';
     parent::__construct();
     if (!App::isAdmin()) {
         throw new E403Exception('403. Доступ запрещен.');
     }
 }
Esempio 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']]]]]);
 }
Esempio n. 4
0
 public function __construct()
 {
     //путь до папки шаблонов
     $this->path = __DIR__ . '/../Views/news/';
     parent::__construct();
 }
Esempio 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']]]]]);
 }
Esempio 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;
     }]]]]);
 }
Esempio n. 7
0
 public function init()
 {
     $this->_cart = Yii::$app->cart;
     parent::init();
 }