public function initialize() { parent::initialize(); if (!self::isNationWideBid()) { $this->pageError('permission'); } }
/** * Initialize this controller. * * @return void */ protected function initialize() { // initialize parent parent::initialize(); // set our content type $this->contentType = $this->getContext()->getRequest()->getParameter('ctype', MO_CONTENT_TYPE); }
/** * Overriding parent * * @return void */ public function initialize() { parent::initialize(); $this->view->addJs('rest'); if ($this->request->getMethod() != 'GET') { $this->view->enableRendering(false); } }
public function initialize() { parent::initialize(); $action = $this->getActionName(); if ($this->isAjax() and in_array($action, ['face', 'visit', 'car', 'reface'])) { //if ($this->checkLoanStatus($uid, $action)) // $this->error('该贷款状态下不能操作'); } }
/** * test initialize() method * * @test */ public function initialize() { $configMethods = array_keys(get_class_vars('ApiComponent')['configMethods']); $this->generateComponent(['mocks' => ['Api' => array_merge($configMethods, ['isApiRequest'])], 'initialize' => false]); $this->Api->expects($this->once())->method('isApiRequest')->will($this->returnValue(true)); foreach ($configMethods as $configMethod) { $this->Api->expects($this->once())->method($configMethod); } $this->Api->initialize($this->controller); }
public function initialize() { parent::initialize(); $this->noMainLayout(); }
public function initialize() { parent::initialize(); $this->afterRcAuthes(); }
public function initialize() { parent::initialize(); $this->set('current_user', $this->Auth->user()); }