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


PHP AppHelper::afterRender方法代码示例

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


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

示例1: afterRender

 /**
  * afterRender
  * 
  * @return void
  * @access public
  */
 function afterRender()
 {
     parent::afterRender();
     // コンテンツをフックする
     $this->_content = ob_get_contents();
 }
开发者ID:nazo,项目名称:phpcondo,代码行数:12,代码来源:baser.php

示例2: afterRender

 /**
  * use the callback of afterRender to inject all JS
  * this triggers AFTER the view, but BEFORE the layout
  * so if you need to customize $this->pathToJs, do so in the view
  * or you can pass in as settings
  * via Html->scriptBlock()
  */
 public function afterRender($viewFile = null)
 {
     $content = parent::afterRender($viewFile);
     if (!empty($this->js)) {
         $content .= $this->Html->css($this->pathToCss, null, array('inline' => false));
         //$content .= $this->Html->script( $this->pathToJs, array('inline' => false) );
         $this->Html->scriptBlock('jQuery(function() { ' . $this->js . '});', array('inline' => false));
     }
     return $content;
 }
开发者ID:jammy-git,项目名称:CakePHP-Eip,代码行数:17,代码来源:EipHelper.php

示例3: afterRender

 /**
  * Callback
  *
  * @access public
  */
 public function afterRender()
 {
     if (!$this->enabled) {
         return;
     }
     parent::afterRender();
     $isDebug = (bool) Configure::read();
     if (empty($this->params['isAjax']) && empty($this->params['requested'])) {
         if (!empty($this->_uses)) {
             $uses = array();
             foreach ($this->_uses as $file) {
                 if (isset($this->fileMap[$file])) {
                     if (is_array($this->fileMap[$file])) {
                         $uses[] = $isDebug ? $this->fileMap[$file][1] : $this->fileMap[$file][0];
                     } else {
                         $uses[] = $this->fileMap[$file];
                     }
                 } else {
                     $uses[] = $file;
                 }
             }
             $this->Javascript->link($uses, false);
         }
         $this->Javascript->cacheEvents($this->cacheToFile, true);
         $this->Javascript->writeEvents(false);
     } else {
         echo $this->Javascript->writeEvents();
     }
     if (!empty($this->_scripts)) {
         $scripts = "\$(function(){\n\t";
         $scripts .= join(ife($isDebug, "\n\t", ' '), $this->_scripts);
         $scripts .= "\n});";
         $View = ClassRegistry::getObject('view');
         $View->set('bottom_for_layout', $this->Javascript->codeBlock($scripts));
     }
 }
开发者ID:hadzi,项目名称:brekfarm,代码行数:41,代码来源:jquery.php

示例4: afterRender

 /**
  * After Render
  *
  * @param string $viewFile
  */
 public function afterRender($viewFile)
 {
     parent::afterRender($viewFile);
     if (BcUtil::isAdminSystem()) {
         return;
     }
     if (empty($this->request->params['Site'])) {
         return;
     }
     if (isset($this->request->params['Site']['name']) && is_null($this->request->params['Site']['name'])) {
         return;
     }
     if (isset($this->request->params['Site']['device']) && $this->request->params['Site']['device'] != '') {
         return;
     }
     // 別URLの場合、alternateを出力(スマートフォンのみ対応)
     $pureUrl = $this->BcContents->getPureUrl($this->request->url, $this->request->params['Site']['id']);
     $agent = BcAgent::find('smartphone');
     $subSite = BcSite::findCurrentSub(false, $agent);
     if (!$subSite) {
         return;
     }
     $url = $subSite->makeUrl(new CakeRequest($pureUrl));
     $this->_View->set('meta', $this->BcHtml->meta('canonical', $this->BcHtml->url($url, true), ['rel' => 'canonical', 'media' => 'only screen and (max-width: 640px)', 'type' => null, 'title' => null, 'inline' => false]));
 }
开发者ID:baserproject,项目名称:basercms,代码行数:30,代码来源:BcBaserHelper.php


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