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


PHP Zend_View::addFilterPath方法代码示例

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


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

示例1: testGetFilters

 public function testGetFilters()
 {
     $base = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR;
     $view = new Zend_View();
     $view->setScriptPath($base . '_templates');
     $view->addFilterPath($base . '_stubs' . DIRECTORY_SEPARATOR . 'FilterDir1');
     $view->addFilter('foo');
     $filters = $view->getFilters();
     $this->assertEquals(1, count($filters));
     $this->assertEquals('foo', $filters[0]);
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:11,代码来源:ViewTest.php

示例2: initView

 function initView()
 {
     $view = new Zend_View();
     $view->setEncoding('UTF-8');
     $fc = Zend_Controller_Front::getInstance();
     $cs = $fc->getControllerDirectory();
     $prefixes = array_keys($cs);
     foreach ($prefixes as $prefix) {
         $viewdir = dirname(dirname(dirname(__FILE__))) . '/' . $prefix . '/Views/';
         $view->addScriptPath($viewdir . 'Scripts');
         $view->addFilterPath($viewdir . 'Filters', $prefix . '_View_Filter_');
         $view->addHelperPath($viewdir . 'Helpers', $prefix . '_View_Helper_');
     }
     return $view;
 }
开发者ID:bersace,项目名称:strass,代码行数:15,代码来源:Action.php

示例3: testFilterPathWithPrefix

 public function testFilterPathWithPrefix()
 {
     $view = new Zend_View();
     $status = $view->addFilterPath(dirname(__FILE__) . '/View/_stubs/HelperDir1/', 'My_View_Filter');
     $this->assertSame($view, $status);
     $filterPaths = $view->getFilterPaths();
     $path = $filterPaths[0];
     $this->assertEquals('My_View_Filter_', $path['prefix']);
     $this->assertEquals($this->normalizePath(dirname(__FILE__) . '/View/_stubs/HelperDir1/'), $path['dir']);
     $view->setFilterPath(dirname(__FILE__) . '/View/_stubs/HelperDir2/', 'Other_View_Filter');
     $filterPaths = $view->getFilterPaths();
     $path = $filterPaths[0];
     $this->assertEquals('Other_View_Filter_', $path['prefix']);
     $this->assertEquals($this->normalizePath(dirname(__FILE__) . '/View/_stubs/HelperDir2/'), $path['dir']);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:15,代码来源:ViewTest.php

示例4: _initView

 /**
  * Initialize the view
  *
  * @return Zend_View
  */
 protected function _initView()
 {
     // Initialize view
     $view = new Zend_View();
     $this->bootstrap('siteSettings');
     // Get settings resource
     $settings = $this->getResource('siteSettings');
     // Set doctype and charset
     $view->doctype($settings->get('doc_type'));
     $view->placeholder('charset')->set($settings->get('default_charset'));
     $view->addFilterPath('Digitalus/View/Filter', 'Digitalus_View_Filter');
     $view->setFilter('Translate');
     // Add the view to the ViewRenderer
     $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
     $viewRenderer->setView($view);
     // base helpers
     $view->addHelperPath('Digitalus/View/Helper', 'Digitalus_View_Helper');
     $view->addHelperPath('Digitalus/Content/Control', 'Digitalus_Content_Control');
     // Load digitalus helpers
     $helperDirs = Digitalus_Filesystem_Dir::getDirectories(BASE_PATH . '/library/Digitalus/View/Helper');
     if (is_array($helperDirs)) {
         foreach ($helperDirs as $dir) {
             $view->addHelperPath(BASE_PATH . '/library/Digitalus/View/Helper/' . $dir, 'Digitalus_View_Helper_' . ucfirst($dir));
         }
     }
     $view->baseUrl = $this->_front->getBaseUrl();
     // Return it, so that it can be stored by the bootstrap
     return $view;
 }
开发者ID:laiello,项目名称:digitalus-cms,代码行数:34,代码来源:Bootstrap.php


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