当前位置: 首页>>代码示例>>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;未经允许,请勿转载。