当前位置: 首页>>代码示例>>PHP>>正文


PHP Controller::beforeRender方法代码示例

本文整理汇总了PHP中Controller::beforeRender方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::beforeRender方法的具体用法?PHP Controller::beforeRender怎么用?PHP Controller::beforeRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Controller的用法示例。


在下文中一共展示了Controller::beforeRender方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeRender

 function beforeRender()
 {
     parent::beforeRender();
     $this->set('parent_categories', ClassRegistry::init('Category')->getParentCategories());
     // Admin permissions
     if (!empty($this->request->params['prefix']) && $this->request->params['prefix'] == 'admin') {
         $this->loadModel('User');
         $this->set('permitted_controllers', $this->User->getWhitelist(AuthComponent::user('role')));
     }
     $this->set('overriden_response', $this->Session->read('response_replaced'));
     // Get number of modified services for currently logged in Facilitator
     if ($this->Auth->user('role') == 'f') {
         $facilitatorId = $this->Auth->user('id');
         // Get updated records
         $facilitatorChampions = $this->User->find('all', array('conditions' => array('facilitator_id' => $facilitatorId)));
         $this->loadModel('ServiceEdit');
         $modifiedServicesForFacilitator = 0;
         foreach ($facilitatorChampions as $key => $value) {
             $modifiedServicesForFacilitator += $this->ServiceEdit->find('count', array('conditions' => array('user_id' => $value['User']['id'], 'approved' => 0)));
         }
         $this->set(compact('modifiedServicesForFacilitator'));
     }
     // Disable login
     //$this->Auth->logout();
     //$this->Session->setFlash( '<strong>Login and registration is currently disabled while we undergo maintenance.</strong> Thanks for your patience.' );
 }
开发者ID:priyankasingh,项目名称:Genie,代码行数:26,代码来源:AppController.php

示例2: beforeRender

 public function beforeRender()
 {
     $this->_setDate();
     $this->set('bodyClass', sprintf('%s %s', strtolower($this->name), strtolower($this->name) . '-' . strtolower($this->action)));
     $this->set(array('isAdmin' => $this->isPrefix('admin'), 'title_for_layout' => $this->titleForLayout, 'currentUser' => $this->currentUser, 'estadosBrasil' => Configure::read('estadosBrasil')));
     return parent::beforeRender();
 }
开发者ID:lucassmacedo,项目名称:Controle-Caixa-CakePHP,代码行数:7,代码来源:AppController.php

示例3: beforeRender

 protected function beforeRender($view)
 {
     if (!$this->module->embed) {
         $this->layout = '/layouts/wdcalendar';
     }
     return parent::beforeRender($view);
 }
开发者ID:cntabana,项目名称:inyungu,代码行数:7,代码来源:DefaultController.php

示例4: beforeRender

 public function beforeRender()
 {
     parent::beforeRender();
     if (isset($this->request->query['ajax'])) {
         unset($this->request->query['ajax']);
     }
 }
开发者ID:RauchF,项目名称:sonerezh,代码行数:7,代码来源:AppController.php

示例5: beforeRender

 public function beforeRender()
 {
     parent::beforeRender();
     if ($this->name == 'CakeError') {
         $this->layout = 'default_error';
     }
 }
开发者ID:elaleprieto,项目名称:vbiblio,代码行数:7,代码来源:AppController.php

示例6: beforeRender

 /**
  * CakePHP's beforeRender callback.
  *
  * @return  void
  * @access  public
  */
 public function beforeRender()
 {
     parent::beforeRender();
     # Set a default page title so that the controller name isn't used
     # @see cake/libs/view/view.php line 480
     $this->set('title_for_layout', '');
 }
开发者ID:robwilkerson,项目名称:CakePHP-Boilerplate,代码行数:13,代码来源:app_controller.php

示例7: beforeRender

 public function beforeRender()
 {
     parent::beforeRender();
     if ($this->request->params['action'] == 'index') {
         $this->set('messageConfirmDelete', $this->Config['Messages']['delete.confirm']);
         $this->set('messagePaginatorDisplay', $this->Config['Messages']['paginator.display']);
     }
 }
开发者ID:Davidsonts,项目名称:Project-Manager,代码行数:8,代码来源:AppController.php

示例8: beforeRender

 public function beforeRender()
 {
     parent::beforeRender();
     if (empty($this->bootSwatched)) {
         $this->bootSwatched = 'Default';
     }
     $this->set('bootSwatched', $this->bootSwatched);
 }
开发者ID:nishant-shrivastava,项目名称:cake-boot-swatched,代码行数:8,代码来源:AppController.php

示例9: beforeRender

 public function beforeRender($view)
 {
     parent::beforeRender($view);
     Yii::app()->clientScript->registerPackage('bootstrap');
     Yii::app()->clientScript->registerPackage('font-awesome');
     Yii::app()->clientScript->registerPackage('jquery.formstyler');
     return true;
 }
开发者ID:Wiedzal,项目名称:araucano,代码行数:8,代码来源:AdminModuleController.php

示例10: beforeRender

 public function beforeRender()
 {
     //        $this->Auth->allow('read_index', 'read_view', 'search', 'signin', 'signup', 'resetcache', 'reset_cache', 'api_read');
     parent::beforeRender();
     if (isset($this->request->query['dev'])) {
         $this->layout = 'dev';
     }
 }
开发者ID:absolutholz,项目名称:andStuffandEverything-Backend--old,代码行数:8,代码来源:AppController.php

示例11: beforeRender

 public function beforeRender()
 {
     $this->layout = 'lay';
     if (isset($this->no_layout[$this->action]) && $this->no_layout[$this->action] == true) {
         $this->layout = '';
     }
     parent::beforeRender();
 }
开发者ID:michelmfreitas,项目名称:iPixels-Restaurante,代码行数:8,代码来源:AppController.php

示例12: beforeRender

 /**
  * Before render callback
  * @see controller::beforeRender
  * @return void
  */
 function beforeRender()
 {
     if ($this->name == 'CakeError') {
         $this->layout = 'error';
     }
     $this->Log->log();
     parent::beforeRender();
 }
开发者ID:stripthis,项目名称:BlackRabbit,代码行数:13,代码来源:app_controller.php

示例13: beforeRender

 public function beforeRender()
 {
     parent::beforeRender();
     $fullName = '';
     if ($this->Auth->user()) {
         $fullName = $this->Auth->user('name');
     }
     $this->set('fullName', $fullName);
 }
开发者ID:hoanglannet,项目名称:copar,代码行数:9,代码来源:app_controller.php

示例14: beforeRender

 public function beforeRender()
 {
     $ctl = $this;
     $auth = $ctl->Auth;
     $title = $ctl->title;
     $keywords = $ctl->keywords;
     $ctl->set(compact('auth', 'title', 'keywords'));
     return parent::beforeRender();
 }
开发者ID:Shiro-Nwal,项目名称:sin-kaisha-khine,代码行数:9,代码来源:AppController.php

示例15: beforeRender

 public function beforeRender()
 {
     parent::beforeRender();
     if ($this->_needProjectMenuBar) {
         $this->loadModel('Deployment');
         $lastDeployment = $this->Deployment->find('first', array('conditions' => array('project_id' => $this->request->pass[0], 'status' => 'completed'), 'order' => array('id desc')));
         $this->set('LastDeployment', $lastDeployment);
     }
 }
开发者ID:sdgdsffdsfff,项目名称:JustDeployIt,代码行数:9,代码来源:AppController.php


注:本文中的Controller::beforeRender方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。