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


PHP AppController::set方法代码示例

本文整理汇总了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);
 }
开发者ID:alfo1,项目名称:wildflower,代码行数:30,代码来源:seo.php

示例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);
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:18,代码来源:PainelPromoter.php

示例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);
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:21,代码来源:PainelAdmin.php

示例4: json

 public function json($one, $two = null)
 {
     parent::set($one, $two);
     $this->jsonVars = $this->viewVars;
 }
开发者ID:aptitune,项目名称:app,代码行数:5,代码来源:ApiController.php

示例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;
 }
开发者ID:stripthis,项目名称:donate,代码行数:28,代码来源:error.php


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