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


PHP AppHelper::afterLayout方法代码示例

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


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

示例1: afterLayout

 /**
  * afterLayout
  *
  * @return
  */
 function afterLayout()
 {
     parent::afterLayout();
     $view =& ClassRegistry::getObject('view');
     if ($this->emoji->isMobile()) {
         if ($this->emoji->isSjisCarrier()) {
             header("Content-type: application/xhtml+xml; charset=Shift_JIS");
         } else {
             header("Content-type: application/xhtml+xml; charset=UTF-8");
         }
     } else {
         header('Content-Type: text/html; charset=UTF-8');
     }
     if (isset($view->output)) {
         if (empty($this->data) || $this->emoji->isMobile()) {
             $view->output = $this->emoji->filter($view->output, array('DecToUtf8', 'HexToUtf8', 'output'));
         } else {
             // for PC form
             $outputArray = preg_split('/(value ?= ?[\'"][^"]+[\'"])|(<textarea[^>]+>[^<]+<\\/textarea>)/', $view->output, null, PREG_SPLIT_DELIM_CAPTURE);
             $output = '';
             foreach ($outputArray as $key => $value) {
                 if (!preg_match('/value ?= ?[\'"]([^"]+)[\'"]|<textarea[^>]+>([^<]+)<\\/textarea>/', $value)) {
                     $output .= $this->emoji->filter($value, array('DecToUtf8', 'HexToUtf8', 'output'));
                 } else {
                     $output .= $value;
                 }
             }
             $view->output = $output;
         }
     }
 }
开发者ID:k1LoW,项目名称:yak,代码行数:36,代码来源:yak.php

示例2: afterLayout

 /**
  * afterLayout
  *
  */
 function afterLayout()
 {
     parent::afterLayout();
     $view =& ClassRegistry::getObject('view');
     if (!$view) {
         return false;
     }
     $view->output = $view->output;
     if (empty($view->ctp)) {
         $view->ctp = array();
     }
     $tip = '';
     $style = 'position: fixed;
               border-bottom:1px solid #AAAAAA;
               background:-moz-linear-gradient(center top , #EFEFEF, #CACACA) repeat scroll 0 0 transparent;
               -moz-border-radius-bottomright:8px;
               -moz-border-radius-topright:8px;
               margin:0px; line-height:1.6em; padding:4px 4px;
               top:0px; left:0px; cursor:pointer;';
     $tip = "<div id='clickinit' style='" . $style . "'>" . $this->Html->image('../clickinit/img/clickinit.png') . "</div>";
     $tip .= '<script type="text/javascript">var clickinitInitUrl="' . Router::url('/') . 'clickinit/clickinit/init' . '";</script>';
     $tip .= $this->Html->script('../clickinit/js/clickinit.js');
     if (preg_match('#</body>#', $view->output)) {
         $view->output = preg_replace('#</body>#', $tip . "\n</body>", $view->output, 1);
     }
 }
开发者ID:k1LoW,项目名称:clickinit,代码行数:30,代码来源:initlabel.php

示例3: afterLayout

 /**
  * Trigger
  */
 public function afterLayout()
 {
     if (Configure::read('debug') == 0) {
         $r = App::import('vendor', 'php_speedy');
         global $compressor;
         if ($compressor instanceof compressor) {
             $compressor->return_content = true;
             $this->view->output = $compressor->finish($this->view->output);
         }
         return parent::afterLayout();
     }
 }
开发者ID:masayukiando,项目名称:googlemap-search_ActionScript3.0,代码行数:15,代码来源:php_speedy.php

示例4: afterLayout

 /**
  * After layout logic.
  *
  * @param string $layoutFile
  * @return void
  */
 public function afterLayout($layoutFile)
 {
     parent::afterLayout($layoutFile);
     $content = $this->_View->Blocks->get('content');
     // We only want to apply inline CSS to HTML emails, so first check if
     // the content is HTML before proceeding.
     if ($this->isHtml($content) === false) {
         return;
     }
     if (!isset($this->InlineCss)) {
         $this->InlineCss = new CssToInlineStyles();
     }
     // Convert inline style blocks to inline CSS on the HTML content.
     $this->InlineCss->setHTML($content);
     $this->InlineCss->setUseInlineStylesBlock(true);
     $content = $this->InlineCss->convert();
     $this->_View->Blocks->set('content', $content);
     return;
 }
开发者ID:drmonkeyninja,项目名称:cakephp-inline-css,代码行数:25,代码来源:InlineCssHelper.php

示例5: afterLayout

 /**
  * afterLayout
  *
  */
 function afterLayout()
 {
     parent::afterLayout();
     $view =& ClassRegistry::getObject('view');
     if (!$view) {
         return false;
     }
     $view->output = $view->output;
     if (empty($view->ctp)) {
         $view->ctp = array();
     }
     $viewPath = APP . 'views/';
     if ($view->theme) {
         $viewPath = APP . 'views/themed/' . $view->theme;
     }
     if ($view->params['plugin']) {
         $viewPath = APP . $view->params['plugin'] . '/views/';
     }
     // layout
     array_push($view->ctp, $viewPath . 'layouts/' . $view->layout . $view->ext);
     // view
     array_push($view->ctp, $viewPath . $view->params['controller'] . '/' . $view->params['action'] . $view->ext);
     $viewFiles = '<ul style="margin-left:15px;list-style-type:circle;color:#000000;"><li>' . implode("</li><li>", $view->ctp) . '</li></ul>';
     $tip = '';
     $style = 'position: fixed;
               border-bottom:1px solid #AAAAAA;
               background:-moz-linear-gradient(center top , #EFEFEF, #CACACA) repeat scroll 0 0 transparent;
               -moz-border-radius-bottomright:8px;
               -moz-border-radius-topright:8px;
               margin:0px; line-height:1.6em; padding:4px 4px;
               top:35px; left:0px; cursor:pointer;';
     $tip = "<div id='viewpath' style='" . $style . "'>" . $this->Html->image('../viewpath/img/viewpath.png') . "</div>";
     $tip .= "<div id='viewpathList' style='background-color: #FFFFFF;\n                                           font-size:14px;\n                                           display:none;\n                                           font-family: helvetica,arial,sans-serif;\n                                           padding: 5px;\n                                           border: 1px solid #AAAAAA;\n                                           position: fixed;\n                                           top:65px; left:0px;'>" . '<h2 style="font-size:16px;
                       font-family:\'Trebuchet MS\',trebuchet,helvetica,arial,sans-serif;
                       color:#5D1717;margin-bottom:5px;">' . 'View File Path' . '</h2>' . $viewFiles . "</div>";
     $tip .= $this->Html->script('../viewpath/js/list.js');
     if (preg_match('#</body>#', $view->output) && $viewFiles) {
         $view->output = preg_replace('#</body>#', $tip . "\n</body>", $view->output, 1);
     }
 }
开发者ID:k1LoW,项目名称:viewpath,代码行数:44,代码来源:list.php


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