本文整理匯總了PHP中Zend_View::getHelperPaths方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_View::getHelperPaths方法的具體用法?PHP Zend_View::getHelperPaths怎麽用?PHP Zend_View::getHelperPaths使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_View
的用法示例。
在下文中一共展示了Zend_View::getHelperPaths方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _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);
}
}
示例2: testConstructorShouldAllowPassingArrayOfHelperPaths
/**
* @group ZF-6087
*/
public function testConstructorShouldAllowPassingArrayOfHelperPaths()
{
$view = new Zend_View(array('helperPath' => array('My_View' => 'My/View/')));
$paths = $view->getHelperPaths();
$this->assertTrue(array_key_exists('My_View_', $paths), var_export($paths, 1));
}
示例3: _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);
}
}
示例4: _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));
}
示例5: 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));
}