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


PHP AppController::beforeRender方法代码示例

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


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

示例1: beforeRender

 /**
  * beforeRender Event
  *
  * @param Event $event Event
  * @return void
  */
 public function beforeRender(Event $event)
 {
     if ($this->_adminAreaIntegration) {
         $this->_setupAdminAreaIntegration();
     }
     parent::beforeRender($event);
 }
开发者ID:scherersoftware,项目名称:cake-wiki,代码行数:13,代码来源:AppController.php

示例2: beforeRender

 /**
  * Before render callback.
  *
  * @param \Cake\Event\Event $event The beforeRender event.
  * @return void
  */
 public function beforeRender(Event $event)
 {
     parent::beforeRender($event);
     $params = $this->request->params;
     $page_id = Inflector::dasherize(implode('-', array_merge([$params['controller']], $params['pass'])));
     $this->set(compact('page_id'));
 }
开发者ID:m-esprit,项目名称:web-app,代码行数:13,代码来源:PagesController.php

示例3: beforeRender

 /**
  * @param Event $event
  */
 public function beforeRender(Event $event)
 {
     if (!$this->request->session()->read('Core.Users')) {
         return $this->redirect('/');
     }
     $this->set('imageFields', $this->imageFields);
     parent::beforeRender($event);
     // TODO: Change the autogenerated stub
 }
开发者ID:nguyennghiem1205,项目名称:Wss,代码行数:12,代码来源:AppController.php

示例4: beforeRender

 /**
  * The Second run
  * Overwrite beforeRender
  * Return response is json type
  */
 public function beforeRender(Event $event)
 {
     parent::beforeRender($event);
     $this->response->type('json');
     // Add hock if check validdate error
     if (!$this->checkValidRequest) {
         $this->response->body(json_encode(array('result_code' => $this->result_code, 'result_detail' => $this->result_detail, 'result_error' => $this->result_error)));
         return $this->response;
         $this->_stop();
     }
 }
开发者ID:TranBinhLuan,项目名称:junzeron,代码行数:16,代码来源:ApiController.php

示例5: beforeRender

 /**
  * beforeRender Event
  *
  * @param Event $event Event
  * @return void
  */
 public function beforeRender(Event $event)
 {
     // For good integration in existing administration areas, configure
     // View things here.
     if (method_exists($this, 'getView')) {
         // CakePHP 3.0.x
         $view = $this->getView();
         $view->layout = Configure::read('Notifications.Administration.layout');
         foreach (Configure::read('Notifications.Administration.helpers') as $helper) {
             $view->loadHelper($helper);
         }
     } else {
         // CakePHP 3.1.x
         $this->viewBuilder()->helpers(Configure::read('Notifications.Administration.helpers'));
         $this->viewBuilder()->layout(Configure::read('Notifications.Administration.layout'));
     }
     parent::beforeRender($event);
 }
开发者ID:codekanzlei,项目名称:cake-notifications,代码行数:24,代码来源:AppController.php

示例6: beforeRender

 public function beforeRender(\Cake\Event\Event $event)
 {
     parent::beforeRender($event);
     if ($this->Entity) {
         $errors = [];
         if ($this->Entity->errors()) {
             foreach ($this->Entity->errors() as $field => $item) {
                 $errors[$field] = array_values($item)[0];
             }
         }
         if ($errors) {
             $this->Output['status'] = API_STATUS_ERROR;
             $this->Output['error_code'] = ERROR_INVALID_VALIDATION;
             $this->Output['errors'] = $errors;
         }
     }
     $this->writeOutput();
 }
开发者ID:nguyennghiem1205,项目名称:Wss,代码行数:18,代码来源:AppController.php

示例7: beforeRender

 /**
  * beforeRender
  *
  * @param \Cake\Event\Event $event Event.
  * @return void
  */
 public function beforeRender(\Cake\Event\Event $event)
 {
     parent::beforeRender($event);
     $this->set('postType', $this->Settings);
 }
开发者ID:cakemanager,项目名称:cakephp-posttypes,代码行数:11,代码来源:AppController.php

示例8: beforeRender

 public function beforeRender(Event $event)
 {
     $this->breadcrumbs[] = ['label' => __('City'), 'link' => ['action' => 'index']];
     switch ($this->request->params['action']) {
         case 'view':
             $this->breadcrumbs[] = ['label' => __('View')];
             break;
         case 'add':
             $this->breadcrumbs[] = ['label' => __('Add'), 'link' => NULL];
             break;
         case 'edit':
             $this->breadcrumbs[] = ['label' => __('Edit')];
             $this->breadcrumbs[] = ['label' => $this->cityData->name];
             break;
     }
     parent::beforeRender($event);
 }
开发者ID:hunnybohara,项目名称:coin_bates,代码行数:17,代码来源:CitiesController.php

示例9: beforeRender

 public function beforeRender(\Cake\Event\Event $event)
 {
     parent::beforeRender($event);
     $this->set('title', 'Lançamento');
 }
开发者ID:QuielSimoes,项目名称:meugarangau,代码行数:5,代码来源:LancamentosController.php

示例10: beforeRender

 /**
  * before render view
  * @param Event $event
  */
 public function beforeRender(Event $event)
 {
     parent::beforeRender($event);
     // TODO: Change the autogenerated stub
     $this->set(['titleLayout' => $this->titleLayout, 'metaDescription' => $this->descriptionMeta, 'metaKeywords' => $this->keywordsMeta, 'sidebarLeft' => $this->sidebarLeft, 'sidebarRight' => $this->sidebarRight, 'fieldLanguage' => $this->fieldLanguage]);
     $this->getAdvertisements();
     $this->getBanners();
     $leftIndustries = $this->JcApiModel->getListData('industries', 0, 20, array(), MEMBER_COMPANY_COUNTRY_VIETNAM);
     if ($this->sidebarLeft) {
         $this->set('leftIndustries', $leftIndustries);
     }
     if ($this->sidebarRight) {
         $listEvents = $this->Activities->find('all', ['conditions' => ['sidebar_right' => true], 'order' => 'modified DESC', 'limit' => 2]);
         $listMagazines = $this->Events->find('all', ['order' => 'modified DESC', 'limit' => 2]);
         if ($listEvents) {
             $listEvents = $listEvents->toArray();
         }
         if ($listMagazines) {
             $listMagazines = $listMagazines->toArray();
         }
         $this->set('listEvents', $listEvents);
         $this->set('listMagazines', $listMagazines);
     }
 }
开发者ID:nguyennghiem1205,项目名称:japan-circle,代码行数:28,代码来源:PagesController.php

示例11: beforeRender

 /**
  * beforeRender callback.
  *
  * @param \Cake\Event\Event $event Event.
  * @return void
  */
 public function beforeRender(Event $event)
 {
     parent::beforeRender($event);
     $this->viewBuilder()->templatePath('Error');
     $this->viewVars['page_id'] = 'error-index';
 }
开发者ID:m-esprit,项目名称:web-app,代码行数:12,代码来源:ErrorController.php

示例12: beforeRender

 public function beforeRender(Event $event)
 {
     parent::beforeRender($event);
     $users = TableRegistry::get('Users');
     $this->set('FirstUser', $users->find('all')->first());
 }
开发者ID:elliot-sawyer,项目名称:photos-cakephp,代码行数:6,代码来源:PhotosController.php

示例13: beforeRender

 public function beforeRender(Event $event)
 {
     $this->set('types', $this->types);
     parent::beforeRender($event);
 }
开发者ID:hunnybohara,项目名称:coin_bates,代码行数:5,代码来源:TaxonomiesController.php

示例14: beforeRender

 /**
  * beforeRender method
  *
  * @param \Cake\Event\Event $event Event
  * @return void
  */
 public function beforeRender(\Cake\Event\Event $event)
 {
     parent::beforeRender($event);
     $this->viewBuilder()->helpers(['GoogleCharts.GoogleCharts']);
 }
开发者ID:BallStateCBER,项目名称:cri,代码行数:11,代码来源:CommunitiesController.php

示例15: beforeRender

 public function beforeRender(Event $event)
 {
     $this->breadcrumbs[] = array('label' => __('User'), 'link' => array('controller' => 'Users', 'action' => 'index'));
     switch ($this->request->params['action']) {
         default:
             $this->showBreadcrumb = FALSE;
             break;
         case 'index':
             break;
         case 'add':
             $this->breadcrumbs[] = array('label' => __('Add'));
             break;
         case 'edit':
             $this->breadcrumbs[] = array('label' => __('Edit'));
             $this->breadcrumbs[] = array('label' => $this->userData->first_name . ' ' . $this->userData->last_name);
             break;
     }
     parent::beforeRender($event);
 }
开发者ID:hunnybohara,项目名称:coin_bates,代码行数:19,代码来源:UsersController.php


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