本文整理汇总了PHP中AppController::beforeRender方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::beforeRender方法的具体用法?PHP AppController::beforeRender怎么用?PHP AppController::beforeRender使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::beforeRender方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeRender
function beforeRender()
{
parent::beforeRender();
if (!Configure::read('Status.allow')) {
return $this->redirect($this->referer());
}
}
示例2: beforeRender
public function beforeRender()
{
parent::beforeRender();
if ($this->request->action === 'admin_login') {
$this->layout = 'login';
}
}
示例3: beforeRender
/**
* Model::beforeRender() callback.
*/
public function beforeRender()
{
parent::beforeRender();
$this->set('attachmentModel', $this->modelClass);
$this->set('model', $this->model);
$this->set('modelId', $this->modelId);
}
示例4: beforeRender
public function beforeRender()
{
parent::beforeRender();
$this->set('exec_time', microtime() - $this->_startTime);
$this->set('totalCount', $this->_totalCount);
$this->set('successCount', $this->_successCount);
}
示例5: beforeRender
/**
* beforeRender callback
*
* @return void
* @access public
*/
public function beforeRender()
{
parent::beforeRender();
if (in_array($this->action, array('add', 'edit', 'home'))) {
$this->set('paymentMethods', array('bank' => __('Bank Account Transfer', true), 'cheque' => __('Post Office Remittance', true)));
}
}
示例6: beforeRender
function beforeRender()
{
parent::beforeRender();
$this->set('service_titles', $this->service_titles);
$this->set('service_status', $this->service_status);
$this->set('service_schedule', $this->service_schedule);
}
示例7: beforeRender
public function beforeRender()
{
parent::beforeRender();
$breadcrumbs = array(array('link' => Router::url(array('controller' => 'pages', 'action' => 'index')), 'text' => __('Home'), 'active' => ''), array('link' => Router::url(array('controller' => 'condos', 'action' => 'index')), 'text' => __n('Condo', 'Condos', 2), 'active' => ''), array('link' => Router::url(array('controller' => 'condos', 'action' => 'view', $this->getPhkRequestVar('condo_id'))), 'text' => $this->getPhkRequestVar('condo_text'), 'active' => ''), array('link' => '', 'text' => __('Drafts'), 'active' => 'active'));
$headerTitle = __('Drafts');
$this->set(compact('breadcrumbs', 'headerTitle'));
}
示例8: beforeRender
public function beforeRender()
{
AppController::beforeRender();
$subMenu = array(array("Autorisations", array('controller' => 'Autorisation', 'action' => 'index'), $this->params['action'] == 'index'), array("Membres", array('controller' => 'Autorisation', 'action' => 'members'), $this->params['action'] == 'members'));
$this->set('subMenu', $subMenu);
$this->layout = 'connected';
}
示例9: beforeRender
public function beforeRender()
{
parent::beforeRender();
$this->set('section', $this->section);
$this->set('CMS', Configure::read('Cms.Name'));
$this->set('admin', $this->Auth->user());
}
示例10: beforeRender
/**
* Called after the controller action is run, but before the view is rendered.
*
* Used to ensure that json responses are handled correctly by the action
*
* @link http://book.cakephp.org/view/984/Callbacks
* @return void
*/
public function beforeRender()
{
parent::beforeRender();
Configure::write('debug', 0);
$this->request->action = 'response';
$this->layout = false;
}
示例11: beforeRender
function beforeRender()
{
parent::beforeRender();
if (strtolower(Configure::read('Newsletter.send_method')) == 'smtp' && $this->Email->smtpError) {
$this->log('newsletter_smtp_errors', $this->Email->smtpError);
Configure::write('Newsletter.smtp_errors', $this->Email->smtpError);
}
}
示例12: beforeRender
public function beforeRender()
{
parent::beforeRender();
if (!empty($this->path)) {
$this->page_data['body_id'] .= '-' . implode('-', $this->path);
$this->set($this->page_data);
}
}
示例13: beforeRender
function beforeRender()
{
parent::beforeRender();
$stateOptions = $this->User->stateOptions();
$groups = $this->Group->find('list', array('fields' => 'id,name'));
$companies = $this->Company->find('list', array('fields' => 'id, name', 'permissionable' => false, 'conditions' => array('Company.history_status' => 1)));
$this->set(compact('stateOptions', 'companies', 'groups'));
}
示例14: beforeRender
public function beforeRender()
{
parent::beforeRender();
$breadcrumbs = array(array('link' => Router::url(array('controller' => 'pages', 'action' => 'index')), 'text' => __('Home'), 'active' => ''));
if ($this->viewVars['page'] == 'login') {
$breadcrumbs[1] = array('link' => '', 'text' => __('Start Session'), 'active' => 'active');
}
$this->set(compact('breadcrumbs'));
}
示例15: beforeRender
/**
* Escapes the viewVars.
*
* @return void
*/
public function beforeRender()
{
parent::beforeRender();
foreach ($this->viewVars as $key => $value) {
if (!is_object($value)) {
$this->viewVars[$key] = h($value);
}
}
}