initialize() public method

Use this method to add common initialization code like loading components. e.g. $this->loadComponent('Security');
public initialize ( ) : void
return void
Exemplo n.º 1
0
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('RequestHandler');
     $this->loadComponent('Paginator');
     $this->loadComponent('Excel');
 }
 /**
  * Initialize callback
  *
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     if ($this->request->action === 'index') {
         $this->loadComponent('Recaptcha.Recaptcha');
     }
 }
Exemplo n.º 3
0
 /**
  * Initialize callback
  *
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     if (in_array($this->request->action, ['index', 'multipleWidgets'])) {
         $this->loadComponent('Recaptcha.Recaptcha');
     }
 }
Exemplo n.º 4
0
 /**
  * Initialize
  *
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('Security');
     $this->loadComponent('Csrf');
     $this->loadComponent('CakeDC/Users.UsersAuth');
 }
Exemplo n.º 5
0
 public function initialize()
 {
     parent::initialize();
     /**
      * Define Content settings
      */
     Configure::write('Content', ['defaultUsersTable' => 'Users', 'defaultRolesTable' => 'Roles', 'defaultSiteId' => 1]);
     /**
      * Manage site selector
      */
     if ($this->request->is(['patch', 'post', 'put'])) {
         if (isset($this->request->data['current_site_id'])) {
             $this->request->session()->write('Content.currentSiteId', intval($this->request->data['current_site_id']));
         }
     }
     $this->CmsSites = TableRegistry::get('Content.CmsSites');
     $sites = $this->CmsSites->find('all')->toArray();
     $site_selector = [];
     foreach ($sites as $row) {
         $site_selector[$row->id] = $row->name;
         if (!$this->request->session()->check('Content.currentSiteId')) {
             $this->request->session()->write('Content.currentSiteId', $row->id);
         }
     }
     $this->set(compact('site_selector'));
 }
Exemplo n.º 6
0
 public function initialize()
 {
     parent::initialize();
     $this->loadModel('Messages');
     $this->loadModel('Offers');
     $this->loadModel('Applies');
 }
Exemplo n.º 7
0
 /**
  * Initialization hook method.
  *
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     // Deny public access
     $this->Auth->deny('index');
     $this->Auth->config('unauthorizedRedirect', ['controller' => 'forums', 'action' => 'index']);
 }
Exemplo n.º 8
0
 public function initialize()
 {
     parent::initialize();
     $this->viewBuilder()->layout('frontend');
     $this->response->disableCache();
     $this->set('webroot_full', Router::url('/', true));
 }
 public function initialize()
 {
     parent::initialize();
     //		$this->connectCrudViews([
     //            'Activities.duplicateActivityRow'
     //            ]);
 }
 /**
  * Initialization hook method.
  *
  * Use this method to add common initialization code like loading components.
  *
  * @return void
  */
 public function initialize()
 {
     $this->helpers[] = 'CkTools.CkTools';
     $this->helpers[] = 'ListFilter.ListFilter';
     $this->components[] = 'ListFilter.ListFilter';
     parent::initialize();
 }
 /**
  *Initialize
  */
 public function initialize()
 {
     parent::initialize();
     // TODO: Change the autogenerated stub
     $this->loadModel('Advertisements');
     $this->loadModel('News');
     $this->loadModel('Banners');
     $this->loadModel('NewsCategories');
     $this->loadModel('Inquiries');
     $this->loadModel('Activities');
     $this->loadModel('Contacts');
     $this->loadModel('Settings');
     $this->loadModel('Members');
     $this->loadModel('HomeMenus');
     $this->loadModel('TypeCompanies');
     $this->loadModel('TypeBusiness');
     $this->loadModel('Productions');
     $this->loadModel('CompanyInquiries');
     $this->loadModel('RegisterInquiries');
     $this->loadModel('EmailStacks');
     $this->loadModel('Members');
     $this->loadModel('Events');
     $this->loadModel('Supporters');
     $this->loadModel('CategorySupporters');
     $this->loadModel('SupporterCities');
 }
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('Flash');
     // Include the FlashComponent
     $this->Auth->allow(['index']);
 }
Exemplo n.º 13
0
 public function initialize()
 {
     parent::initialize();
     // Set the layout
     $this->viewBuilder()->layout('admin');
     $this->loadComponent('Cewi/Excel.Import');
 }
Exemplo n.º 14
0
 public function initialize()
 {
     parent::initialize();
     $this->loadModel('Activities');
     $this->loadModel('Favoris');
     $this->loadModel('Offers');
 }
Exemplo n.º 15
0
 /**
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     $this->viewClass = 'CrudView\\View\\CrudView';
     $tables = ['Clients', 'Scopes'];
     $this->loadComponent('Crud.Crud', ['actions' => ['index' => ['className' => 'Crud.Index', 'scaffold' => ['tables' => $tables]], 'view' => ['className' => 'Crud.View', 'scaffold' => ['tables' => $tables]], 'edit' => ['className' => 'Crud.Edit', 'scaffold' => ['tables' => $tables, 'fields' => ['id' => ['label' => 'ID', 'type' => 'text'], 'description']]], 'add' => ['className' => 'Crud.Add', 'scaffold' => ['tables' => $tables, 'fields' => ['id' => ['label' => 'ID', 'type' => 'text'], 'description']]], 'delete' => ['className' => 'Crud.Delete', 'scaffold' => ['tables' => $tables]]], 'listeners' => ['CrudView.View', 'Crud.RelatedModels', 'Crud.Redirect']]);
 }
Exemplo n.º 16
0
 public function initialize()
 {
     parent::initialize();
     // Set the layout
     $this->viewBuilder()->layout('admin');
     //$this->Auth->allow();
 }
Exemplo n.º 17
0
 /**
  * Initialization Hook.
  *
  * @return void
  */
 public function initialize()
 {
     $this->loadModel('Users');
     $this->loadComponent('RequestHandler');
     $this->loadComponent('CkTools.Api');
     parent::initialize();
 }
Exemplo n.º 18
0
 /**
  * Initialization hook method.
  *
  * Use this method to add common initialization code like loading components.
  *
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     $this->layout = 'sl';
     $this->loadComponent('Paginator');
     $this->Auth->allow(array('view', 'index'));
     $this->set('homepage_title', __('Homepage Title'));
     $this->loadModel('BlogCategories');
     $this->set('asideBlogCategories', $this->BlogCategories->find('all', array('conditions' => array('enable' => true), 'recursive' => -1))->toArray());
     $this->loadModel('Tags');
     $this->set('asideTags', $this->Tags->find('all', array('conditions' => array('not' => array('taggings_count' => 0)), 'order' => array('taggings_count desc'), 'recursive' => -1))->toArray());
     $session = $this->request->session();
     $this->set('session', $session);
     /*
     if($session->check('theme')) {
     $this->theme=$session->read('theme');
     } else {
     $this->theme=null;
     }
     */
     if ($session->check('Config.language')) {
         I18n::locale($session->read('Config.language'));
     } else {
         I18n::locale($session->read('ko_KR'));
     }
 }
Exemplo n.º 19
0
 public function initialize()
 {
     parent::initialize();
     $this->viewBuilder()->layout('sample');
     $this->set('header', '* this is sample site *');
     $this->set('footer', 'copyright 2015 libro.');
 }
Exemplo n.º 20
0
 public function initialize()
 {
     parent::initialize();
     $this->loadModel('Ordenes');
     $this->loadModel('Maquinas');
     $this->loadModel('Clientes');
 }
Exemplo n.º 21
0
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('RequestHandler');
     $this->loadModel('Characters');
     $this->loadModel('Credits');
 }
Exemplo n.º 22
0
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('RequestHandler');
     $this->loadModel('DeviceSoftware');
     $this->loadModel('DeviceData');
 }
Exemplo n.º 23
0
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('UserPerm');
     $this->loadComponent('CalUtil');
     $this->Auth->allow(['ics']);
 }
Exemplo n.º 24
0
 public function initialize()
 {
     parent::initialize();
     $this->loadComponent('Flash');
     $this->set(compact('customers'));
     $customer = $this->Customers->newEntity();
     $this->{$customer};
 }
 public function initialize()
 {
     parent::initialize();
     //$this->Auth->allow('register');
     if (in_array($this->request->action, ['register', 'login', 'forgot_password_step_1', 'forgot_password_step_2'])) {
         $this->viewBuilder()->layout('empty');
     }
 }
Exemplo n.º 26
0
 public function initialize()
 {
     parent::initialize();
     $this->loadModel('ClientesDireccions');
     $this->loadModel('ClientesHistoricos');
     $this->loadModel('Pedidos');
     //Aseguradoras_clientes
 }
Exemplo n.º 27
0
 /**
  * Initialize handle.
  *
  * @return void
  */
 public function initialize()
 {
     parent::initialize();
     $action = $this->request->action;
     if ($action === 'login' || $action === 'forgotPassword') {
         $this->loadComponent('Recaptcha.Recaptcha');
     }
 }
 /**
  * 初期化処理
  * beforeFilter() メソッドの前に呼び出される。
  *
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     // 共通ログイン認証を行う
     parent::loginCheck();
     // Csrfコンポーネント読み込み
     $this->loadComponent('Csrf');
 }
 public function initialize()
 {
     parent::initialize();
     // Include components
     $this->loadComponent('Flash');
     $this->loadComponent('RequestHandler');
     $this->loadComponent('Paginator');
 }
Exemplo n.º 30
0
 public function initialize()
 {
     parent::initialize();
     if ($this->request->action === 'register') {
         $this->loadComponent('Recaptcha.Recaptcha');
     }
     $this->Auth->allow(['forgotPassword', 'login', 'logout', 'members', 'register', 'resetPassword', 'view']);
 }