當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Component::startup方法代碼示例

本文整理匯總了PHP中Component::startup方法的典型用法代碼示例。如果您正苦於以下問題:PHP Component::startup方法的具體用法?PHP Component::startup怎麽用?PHP Component::startup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Component的用法示例。


在下文中一共展示了Component::startup方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: startup

 public function startup()
 {
     if ($data = $this->Cookie->read($this->cookieVarname)) {
         $this->data = $data;
     }
     return parent::startup();
 }
開發者ID:Ephigenia,項目名稱:harrison,代碼行數:7,代碼來源:Lightbox.php

示例2: startup

 /**
  * For this helper the controller has to be passed as reference
  * for manual startup with $disableStartup = true (requires this to be called prior to any other method)
  *
  * @return void
  */
 public function startup(Controller $Controller = null)
 {
     parent::startup($Controller);
     // Data preparation
     if (!empty($this->Controller->request->data) && !Configure::read('DataPreparation.notrim')) {
         $this->Controller->request->data = $this->trimDeep($this->Controller->request->data);
     }
     if (!empty($this->Controller->request->query) && !Configure::read('DataPreparation.notrim')) {
         $this->Controller->request->query = $this->trimDeep($this->Controller->request->query);
     }
     if (!empty($this->Controller->request->params['named']) && !Configure::read('DataPreparation.notrim')) {
         $this->Controller->request->params['named'] = $this->trimDeep($this->Controller->request->params['named']);
     }
     if (!empty($this->Controller->request->params['pass']) && !Configure::read('DataPreparation.notrim')) {
         $this->Controller->request->params['pass'] = $this->trimDeep($this->Controller->request->params['pass']);
     }
     // Information gathering
     if (!Configure::read('App.disableMobileDetection') && ($mobile = $this->Session->read('Session.mobile')) === null) {
         App::uses('UserAgentLib', 'Tools.Lib');
         $UserAgentLib = new UserAgentLib();
         $mobile = (int) $UserAgentLib->isMobile();
         $this->Session->write('Session.mobile', $mobile);
     }
     // Auto layout switch
     if ($this->Controller->request->is('ajax')) {
         $this->Controller->layout = 'ajax';
     }
 }
開發者ID:ByMyHandsOnly,項目名稱:BMHO_Web,代碼行數:34,代碼來源:CommonComponent.php

示例3: startup

 /**
  * Take a comma seperated list of id's and save them in the matching order
  *
  * @param Controller $controller
  */
 public function startup(Controller $controller)
 {
     parent::startup($controller);
     $postedRanks = Hash::extract($controller->request->data, '{s}.updated-ranks');
     if ($controller->request->is('post') && !empty($postedRanks)) {
         $ranks = explode(',', $postedRanks[0]);
         $i = 0;
         foreach ($ranks as $order => $rowId) {
             $data[$i][$this->settings['model']][$this->settings['field']] = $rowId;
             $data[$i][$this->settings['model']][$this->settings['sortField']] = $order + 1;
             // As arrays count from 0, but our ranks count from 1
             $i++;
         }
         $element = 'default';
         if ($this->settings['useNiceAdmin']) {
             $element = 'NiceAdmin.alert-box';
         }
         $controller->loadModel($this->settings['model']);
         if ($controller->{$this->settings['model']}->saveAll($data, array('validate' => false))) {
             $controller->Session->setFlash($this->settings['model'] . ' order updated', $element, array('class' => 'alert-success'));
             $controller->redirect($controller->referer());
         } else {
             $controller->Session->setFlash($this->settings['model'] . ' order could not be updated, please try again', $element, array('class' => 'alert-error'));
         }
     }
 }
開發者ID:Adnan0703,項目名稱:CakePHP-Sortable,代碼行數:31,代碼來源:SortableComponent.php

示例4: startup

 /**
  * MobileComponent::startup()
  *
  * @param Controller $Controller
  * @return void
  */
 public function startup(Controller $Controller)
 {
     parent::startup($Controller);
     if ($this->settings['on'] !== 'startup') {
         return;
     }
     $this->_init();
 }
開發者ID:ByMyHandsOnly,項目名稱:BMHO_Web,代碼行數:14,代碼來源:MobileComponent.php

示例5: startup

 /**
  * Run after controller beforeFilter method
  * @param Controller $controller
  */
 public function startup(Controller $controller)
 {
     parent::startup($controller);
     if (isset($controller->request->params['name'])) {
         $this->__requestedModule = Inflector::camelize($controller->request->params['name']);
         $this->__needInstall();
     }
 }
開發者ID:simaostephanie,項目名稱:Cloggy,代碼行數:12,代碼來源:CloggyModuleInstallerComponent.php

示例6: startup

 public function startup($controller)
 {
     parent::startup($controller);
     $collection = new ComponentCollection();
     $this->Acl = new AclComponent($collection);
     $controller = null;
     $this->Acl->startup($controller);
     $this->Aco = $this->Acl->Aco;
 }
開發者ID:aichelman,項目名稱:StudyUp,代碼行數:9,代碼來源:AclActionListComponent.php

示例7: startup

 public function startup(Controller $controller)
 {
     parent::startup($controller);
     $this->Controller = $controller;
     //  コントローラがページネーションを使っているか確かめる
     if (!isset($this->Controller->paginate)) {
         $this->Controller->paginate = array();
     }
 }
開發者ID:himeno,項目名稱:cakephp_unittest,代碼行數:9,代碼來源:PagematronComponent.php

示例8: startup

 public function startup(\Controller $controller)
 {
     // definindo alguns dados padrões
     $config = Configure::read('PagSeguro');
     if ($config) {
         $this->credenciais = new PagSeguroAccountCredentials($config['credenciais']['email'], $config['credenciais']['token']);
     }
     parent::startup($controller);
 }
開發者ID:rsdevigo,項目名稱:cakephp-pagseguro,代碼行數:9,代碼來源:ConsultaComponent.php

示例9: startup

 /**
  * perform needed initialization and cache the controller that called us
  */
 public function startup($controller)
 {
     parent::startup($controller);
     if (!defined('SESSION_UNSAFE')) {
         define('SESSION_UNSAFE', false);
     }
     if (CLI) {
         return;
     }
 }
開發者ID:emente,項目名稱:kataii---kata-framework-2.x,代碼行數:13,代碼來源:session.php

示例10: startup

 /**
  * 
  * Setup menus at startup
  * @param Controller $controller
  */
 public function startup(Controller $controller)
 {
     parent::startup($controller);
     /*
      * only at module page
      */
     if (isset($controller->request->params['name'])) {
         $moduleName = Inflector::camelize($controller->request->params['name']);
         $checkMenus = $this->isModuleHasMenus($moduleName);
         if ($checkMenus) {
             $this->parseModuleMenus($moduleName);
         }
     }
 }
開發者ID:simaostephanie,項目名稱:Cloggy,代碼行數:19,代碼來源:CloggyModuleMenuComponent.php

示例11: startup

 /**
  * called by controller after the component was instanciated first
  * @param object $controller the calling controller
  */
 public function startup($controller)
 {
     parent::startup($controller);
     $this->setCode($this->findLanguage());
     if (!defined('LANGUAGE_FALLBACK')) {
         define('LANGUAGE_FALLBACK', false);
     }
     if (!defined('LANGUAGE_WARNEMPTY')) {
         define('LANGUAGE_WARNEMPTY', true);
     }
     if (!defined('LANGUAGE_ESCAPE')) {
         define('LANGUAGE_ESCAPE', false);
     }
 }
開發者ID:emente,項目名稱:kataii---kata-framework-2.x,代碼行數:18,代碼來源:locale.php

示例12: startup

 /**
  * Called after the Controller::beforeFilter() and before the controller action
  * 
  * @param $controller Controller
  * @return void
  */
 public function startup($controller)
 {
     parent::startup($controller);
     $this->_debug($this->Controller->request);
 }
開發者ID:sanyaade-machine-learning,項目名稱:Catool,代碼行數:11,代碼來源:OpenidAuthServiceComponent.php

示例13: startup

 /**
  * Startup component
  *
  * @param object $controller Instantiating controller
  * @access public
  */
 public function startup(Controller $controller)
 {
     parent::startup($controller);
 }
開發者ID:shahensargsyan,項目名稱:aiisa,代碼行數:10,代碼來源:UploadComponent.php

示例14: startup

 /**
  * 
  * @param Controller $controller
  */
 public function startup(Controller $controller)
 {
     parent::startup($controller);
     $this->Controller = $controller;
 }
開發者ID:naow9y,項目名稱:basercms,代碼行數:9,代碼來源:BcManagerComponent.php

示例15: startup

 /**
  * Check module user access
  * Only for checking module 
  * @param Controller $controller
  */
 public function startup(Controller $controller)
 {
     parent::startup($controller);
     /*
      * only at requested module
      */
     if (isset($this->__Controller->request->params['isCloggyModule']) && $this->__Controller->request->params['isCloggyModule'] == 1) {
         //setup aro data
         $this->generateAro();
         //run acl for module
         $this->proceedAcl('controller');
         //get flag
         $isAllowed = $this->isAroAllowed();
         /*
          * if not allowed proceed callback
          */
         if (!$isAllowed) {
             $this->proceedCallback();
         }
     }
 }
開發者ID:simaostephanie,項目名稱:Cloggy,代碼行數:26,代碼來源:CloggyAclComponent.php


注:本文中的Component::startup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。