本文整理汇总了PHP中AppController::set方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::set方法的具体用法?PHP AppController::set怎么用?PHP AppController::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::set方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: title
/**
* Build SEO title
*
* @param string $pageTitle Title of the current item/page/posts...
*/
function title($pageTitle = null)
{
if (!is_object($this->controller)) {
return;
}
if (!$pageTitle) {
$pageTitle = $this->controller->pageTitle;
}
if (!$pageTitle) {
$pageTitle = ucwords($this->controller->params['controller']);
}
$description = Configure::read('AppSettings.description');
$nameAndDescription = hsc(Configure::read('AppSettings.site_name'));
if ($description) {
$description = hsc($description);
$nameAndDescription = "{$nameAndDescription} - {$description}";
}
if ($this->controller->isHome) {
$this->controller->pageTitle = $nameAndDescription;
} else {
$this->controller->pageTitle = "{$pageTitle} • {$nameAndDescription}";
}
$this->controller->set('page_title_for_layout', $pageTitle);
$this->controller->set('site_title_for_layout', $nameAndDescription);
}
示例2: parametros
/**
*
* @param AppController $class
*/
protected function parametros(AppController $class)
{
$endereco = null;
$modelEventos = new Evento();
$meusEventos = $modelEventos->verificaEventosParaPromoter(Session::read('Usuario.pessoas_id'));
if (Session::check('Empresa')) {
$modelEndereco = new Endereco();
$endereco = $modelEndereco->findEnderecosEmpresa(Session::read('Empresa.empresas_id'));
$endereco = $endereco[0];
}
$class->set('title_layout', 'Painel Administrativo');
$class->set('endereco', $endereco);
$class->set('meusEventos', $meusEventos);
}
示例3: parametros
protected function parametros(\AppController $class)
{
$clientes = 0;
$funcionarios = 0;
$class->addJs(array('js/chart-js/Chart', 'js/chartjs.init'));
$endereco = null;
if (Session::check('Empresa')) {
$modelCliente = new Cliente();
$modelFuncionario = new Funcionario();
$clientes = $modelCliente->clientesProprietario(Session::read('Usuario.pessoas_id'), Session::read('Usuario.roles_id'));
$clientes = count($clientes);
$funcionarios = $modelFuncionario->find('all', array('empresas_id' => Session::read('Empresa.empresas_id')));
$funcionarios = count($funcionarios);
$endereco = $this->Endereco->findEnderecosEmpresa(Session::read('Empresa.empresas_id'));
$endereco = $endereco[0];
}
$class->set('title_layout', 'Painel Administrativo');
$class->set('endereco', $endereco);
$class->set('clientes', $clientes);
$class->set('funcionarios', $funcionarios);
}
示例4: json
public function json($one, $two = null)
{
parent::set($one, $two);
$this->jsonVars = $this->viewVars;
}
示例5: render
/**
* Renders a view with information about what caused this Exception. $info['type'] is used to determine what
* view inside of views/exceptions/ is used. The default is 'unknown.ctp'.
*
* @return void
* @access public
*/
function render()
{
$info = am($this->where(), $this->info);
$Controller = new AppController();
$Controller->viewPath = 'exceptions';
$Controller->layout = 'exception';
$Dispatcher = new Dispatcher();
$Controller->base = $Dispatcher->baseUrl();
$Controller->webroot = $Dispatcher->webroot;
$isException = true;
$Controller->set(compact('info', 'isException'));
$Controller->beforeRender();
$View = new View($Controller);
$view = @$info['type'];
if (!file_exists(VIEWS . 'exceptions' . DS . $view . '.ctp')) {
$view = 'unknown';
}
header("HTTP/1.0 500 Internal Server Error");
echo $View->render($view);
return;
}