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


PHP Zend_Layout::getLayoutPath方法代码示例

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


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

示例1: preDispatch

 /**
  * Switch viewRenderer responseSegment to
  * segment received from request
  */
 public function preDispatch()
 {
     /**
      * Custom action views placed in themes 
      */
     $viewRenderer = $this->getBroker()->load('viewRenderer');
     $module = $this->getRequest()->getModuleName();
     $options = $this->getOptions();
     $viewPath = realpath($this->_layout->getLayoutPath() . '/../' . $options['view']['directory'] . '/' . $module . '/scripts/');
     $existingPaths = array();
     foreach ($this->_layout->getView()->resolver()->getPaths() as $path) {
         $existingPaths[] = $path;
     }
     if ($viewPath && !in_array($viewPath, $existingPaths)) {
         $this->_layout->getView()->resolver()->addPath($viewPath);
     }
     /**
      * Set widget markers into the new form parameters
      */
     $widgetId = $this->getRequest()->getParam($this->_widgetIdName);
     if ($widgetId !== null) {
         $formHelper = $this->_layout->getView()->getBroker()->load('form');
         if ($formHelper instanceof \Zly\View\Helper\Form) {
             $formHelper->setMarker($this->_widgetPostMarker, $widgetId);
         }
     }
     /**
      * Check post parameters
      */
     $postFormMarker = $this->getRequest()->getParam($this->_widgetPostMarker);
     if ($this->getRequest()->isPost()) {
         if ($postFormMarker !== null && $widgetId === null) {
             //id not widget request and post marker found
             $_SERVER['REQUEST_METHOD'] = 'GET';
             $this->_POST = $_POST;
         } elseif ($widgetId !== $postFormMarker) {
             //if post marker NOT of current widget request
             $_SERVER['REQUEST_METHOD'] = 'GET';
             $this->_POST = $_POST;
         }
     }
     if ($postFormMarker !== null && $widgetId == $postFormMarker && !empty($this->_POST)) {
         $_SERVER['REQUEST_METHOD'] = 'POST';
         $_POST = $this->_POST;
         $this->_POST = null;
     }
     /**
      * Set view renderer segment of current widget
      */
     $slot = $this->getRequest()->getParam($this->_marker, null);
     $viewRenderer->setResponseSegment($slot);
 }
开发者ID:zendmaniacs,项目名称:zly-templater,代码行数:56,代码来源:Widget.php

示例2: testLayoutPathAccessorsWork

 /**
  * @return void
  */
 public function testLayoutPathAccessorsWork()
 {
     $layout = new Zend_Layout();
     $layout->setLayoutPath(dirname(__FILE__));
     $this->assertEquals(dirname(__FILE__), $layout->getLayoutPath());
 }
开发者ID:hjr3,项目名称:zf2,代码行数:9,代码来源:LayoutTest.php


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