本文整理汇总了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.' );
}
示例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();
}
示例3: beforeRender
protected function beforeRender($view)
{
if (!$this->module->embed) {
$this->layout = '/layouts/wdcalendar';
}
return parent::beforeRender($view);
}
示例4: beforeRender
public function beforeRender()
{
parent::beforeRender();
if (isset($this->request->query['ajax'])) {
unset($this->request->query['ajax']);
}
}
示例5: beforeRender
public function beforeRender()
{
parent::beforeRender();
if ($this->name == 'CakeError') {
$this->layout = 'default_error';
}
}
示例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', '');
}
示例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']);
}
}
示例8: beforeRender
public function beforeRender()
{
parent::beforeRender();
if (empty($this->bootSwatched)) {
$this->bootSwatched = 'Default';
}
$this->set('bootSwatched', $this->bootSwatched);
}
示例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;
}
示例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';
}
}
示例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();
}
示例12: beforeRender
/**
* Before render callback
* @see controller::beforeRender
* @return void
*/
function beforeRender()
{
if ($this->name == 'CakeError') {
$this->layout = 'error';
}
$this->Log->log();
parent::beforeRender();
}
示例13: beforeRender
public function beforeRender()
{
parent::beforeRender();
$fullName = '';
if ($this->Auth->user()) {
$fullName = $this->Auth->user('name');
}
$this->set('fullName', $fullName);
}
示例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();
}
示例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);
}
}