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


PHP Zend_View::getScriptPaths方法代码示例

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


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

示例1: preDispatch

 /**
  * Непосредственный поиск шаблонов вида
  *
  * @param Zend_Controller_Request_Abstract $request	Объект запроса
  */
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $this->_view = Zend_Layout::startMvc()->getView();
     $dirs = array(MODULES_PATH . DS . $this->_getModuleName(), HEAP_PATH . DS . $this->_getModuleName());
     $inView = $this->_view->getScriptPaths();
     foreach ($dirs as $dir) {
         self::addBasePath($dir);
     }
 }
开发者ID:kytvi2p,项目名称:ZettaFramework,代码行数:14,代码来源:Layout.php

示例2: _prepareView

 /**
  * Prepare view to be used
  *
  * @return void
  */
 private function _prepareView()
 {
     $defaultScriptPath = $this->getApplicationPath() . '/views/scripts/';
     if (!in_array($defaultScriptPath, $this->view->getScriptPaths())) {
         $this->view->addScriptPath($defaultScriptPath);
     }
     $defaultHelperPath = $this->getApplicationPath() . '/views/helpers/';
     if (!in_array($defaultHelperPath, $this->view->getHelperPaths())) {
         $this->view->addHelperPath($defaultHelperPath);
     }
 }
开发者ID:JellyBellyDev,项目名称:zle,代码行数:16,代码来源:Mvc.php

示例3: testAddingStreamSchemeAsScriptPathShouldNotMangleThePath

 /**
  * @group ZF-9000
  * @group ZF-4622
  */
 public function testAddingStreamSchemeAsScriptPathShouldNotMangleThePath()
 {
     $view = new Zend_View();
     $path = rtrim('file://' . str_replace('\\', '/', realpath(dirname(__FILE__))), '/') . '/';
     $view->addScriptPath($path);
     $paths = $view->getScriptPaths();
     $this->assertContains($path, $paths, var_export($paths, 1));
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:12,代码来源:ViewTest.php

示例4: _testBasePath

    protected function _testBasePath(Zend_View $view, $base, $classPrefix = null)
    {
        $scriptPaths = $view->getScriptPaths();
        $helperPaths = $view->getHelperPaths();
        $filterPaths = $view->getFilterPaths();
        $this->assertContains($base . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR, $scriptPaths);

        $found  = false;
        $prefix = false;
        foreach ($helperPaths as $path) {
            if ($path['dir'] == $base . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR) {
                $found  = true;
                $prefix = $path['prefix'];
                break;
            }
        }
        $this->assertTrue($found, var_export($helperPaths, 1));
        if (null !== $classPrefix) {
            $this->assertTrue($prefix !== false);
            $this->assertEquals($classPrefix . '_Helper_', $prefix);
        }

        $found  = false;
        $prefix = false;
        foreach ($filterPaths as $path) {
            if ($path['dir'] == $base . DIRECTORY_SEPARATOR . 'filters' . DIRECTORY_SEPARATOR) {
                $found  = true;
                $prefix = $path['prefix'];
                break;
            }
        }
        $this->assertTrue($found, var_export($filterPaths, 1));
        if (null !== $classPrefix) {
            $this->assertTrue($prefix !== false);
            $this->assertEquals($classPrefix . '_Filter_', $prefix);
        }
    }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:37,代码来源:ViewTest.php

示例5: testAddingStreamSchemeAsScriptPathShouldNotReverseSlashesOnWindows

 /**
  * @group ZF-9000
  */
 public function testAddingStreamSchemeAsScriptPathShouldNotReverseSlashesOnWindows()
 {
     if (false === strstr(strtolower(PHP_OS), 'windows')) {
         $this->markTestSkipped('Windows-only test');
     }
     $view = new Zend_View();
     $path = rtrim('file://' . str_replace('\\', '/', realpath(dirname(__FILE__))), '/') . '/';
     $view->addScriptPath($path);
     $paths = $view->getScriptPaths();
     $this->assertContains($path, $paths, var_export($paths, 1));
 }
开发者ID:nbcutech,项目名称:o3drupal,代码行数:14,代码来源:ViewTest.php

示例6: _testBasePath

 protected function _testBasePath(Zend_View $view, $base)
 {
     $scriptPaths = $view->getScriptPaths();
     $helperPaths = $view->getHelperPaths();
     $filterPaths = $view->getFilterPaths();
     $this->assertContains($base . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR, $scriptPaths);
     $found = false;
     foreach ($helperPaths as $path) {
         if ($path['dir'] == $base . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR) {
             $found = true;
             break;
         }
     }
     $this->assertTrue($found, var_export($helperPaths, 1));
     $found = false;
     foreach ($filterPaths as $path) {
         if ($path['dir'] == $base . DIRECTORY_SEPARATOR . 'filters' . DIRECTORY_SEPARATOR) {
             $found = true;
             break;
         }
     }
     $this->assertTrue($found, var_export($filterPaths, 1));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:23,代码来源:ViewTest.php

示例7: testSetConfigInConstructor

 public function testSetConfigInConstructor()
 {
     $scriptPath = $this->normalizePath(dirname(__FILE__) . '/View/_templates/');
     $helperPath = $this->normalizePath(dirname(__FILE__) . '/View/_stubs/HelperDir1/');
     $filterPath = $this->normalizePath(dirname(__FILE__) . '/View/_stubs/HelperDir1/');
     $config = array('escape' => 'strip_tags', 'encoding' => 'UTF-8', 'scriptPath' => $scriptPath, 'helperPath' => $helperPath, 'filterPath' => $filterPath, 'filter' => 'urlencode');
     $view = new Zend_View($config);
     $scriptPaths = $view->getScriptPaths();
     $helperPaths = $view->getHelperPaths();
     $filterPaths = $view->getFilterPaths();
     $this->assertContains($this->normalizePath($scriptPath), $scriptPaths);
     $found = false;
     foreach ($helperPaths as $pathInfo) {
         if (strstr($pathInfo['dir'], $helperPath)) {
             $found = true;
         }
     }
     $this->assertTrue($found, var_export($helperPaths, 1));
     $found = false;
     foreach ($filterPaths as $pathInfo) {
         if (strstr($pathInfo['dir'], $filterPath)) {
             $found = true;
         }
     }
     $this->assertTrue($found, var_export($filterPaths, 1));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:26,代码来源:ViewTest.php

示例8: testClearScriptPath

 /**
  * Test that script paths are cleared following setScriptPath(null) call
  */
 public function testClearScriptPath()
 {
     $view = new Zend_View();
     // paths should be initially empty
     $this->assertSame(array(), $view->getScriptPaths());
     // add a path
     $view->setScriptPath('foo');
     $scriptPaths = $view->getScriptPaths();
     $this->assertType('array', $scriptPaths);
     $this->assertEquals(1, count($scriptPaths));
     // clear paths
     $view->setScriptPath(null);
     $this->assertSame(array(), $view->getScriptPaths());
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:17,代码来源:ViewTest.php


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