Use this method to add common initialization code like loading components.
e.g. $this->loadComponent('Security');
public initialize ( ) : void | ||
return | void |
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'); } }
/** * Initialize callback * * @return void */ public function initialize() { parent::initialize(); if (in_array($this->request->action, ['index', 'multipleWidgets'])) { $this->loadComponent('Recaptcha.Recaptcha'); } }
/** * Initialize * * @return void */ public function initialize() { parent::initialize(); $this->loadComponent('Security'); $this->loadComponent('Csrf'); $this->loadComponent('CakeDC/Users.UsersAuth'); }
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')); }
public function initialize() { parent::initialize(); $this->loadModel('Messages'); $this->loadModel('Offers'); $this->loadModel('Applies'); }
/** * 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']); }
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']); }
public function initialize() { parent::initialize(); // Set the layout $this->viewBuilder()->layout('admin'); $this->loadComponent('Cewi/Excel.Import'); }
public function initialize() { parent::initialize(); $this->loadModel('Activities'); $this->loadModel('Favoris'); $this->loadModel('Offers'); }
/** * @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']]); }
public function initialize() { parent::initialize(); // Set the layout $this->viewBuilder()->layout('admin'); //$this->Auth->allow(); }
/** * Initialization Hook. * * @return void */ public function initialize() { $this->loadModel('Users'); $this->loadComponent('RequestHandler'); $this->loadComponent('CkTools.Api'); parent::initialize(); }
/** * 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')); } }
public function initialize() { parent::initialize(); $this->viewBuilder()->layout('sample'); $this->set('header', '* this is sample site *'); $this->set('footer', 'copyright 2015 libro.'); }
public function initialize() { parent::initialize(); $this->loadModel('Ordenes'); $this->loadModel('Maquinas'); $this->loadModel('Clientes'); }
public function initialize() { parent::initialize(); $this->loadComponent('RequestHandler'); $this->loadModel('Characters'); $this->loadModel('Credits'); }
public function initialize() { parent::initialize(); $this->loadComponent('RequestHandler'); $this->loadModel('DeviceSoftware'); $this->loadModel('DeviceData'); }
public function initialize() { parent::initialize(); $this->loadComponent('UserPerm'); $this->loadComponent('CalUtil'); $this->Auth->allow(['ics']); }
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'); } }
public function initialize() { parent::initialize(); $this->loadModel('ClientesDireccions'); $this->loadModel('ClientesHistoricos'); $this->loadModel('Pedidos'); //Aseguradoras_clientes }
/** * 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'); }
public function initialize() { parent::initialize(); if ($this->request->action === 'register') { $this->loadComponent('Recaptcha.Recaptcha'); } $this->Auth->allow(['forgotPassword', 'login', 'logout', 'members', 'register', 'resetPassword', 'view']); }