本文整理汇总了PHP中Zend_View_Abstract::addBasePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Abstract::addBasePath方法的具体用法?PHP Zend_View_Abstract::addBasePath怎么用?PHP Zend_View_Abstract::addBasePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View_Abstract
的用法示例。
在下文中一共展示了Zend_View_Abstract::addBasePath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Set initial settings and call init()
*
* @param array $settings
*/
function __construct($settings = array())
{
$this->settings = $settings;
$layout = Zend_Layout::getMvcInstance();
$this->view = $layout->getView();
// Add module paths to view scripts
$this->view->addBasePath(ZfApplication::$_base_path . "/app/Flex/views", "Flex_View");
$this->view->addScriptPath($layout->getLayoutPath() . "default/templates/Flex/");
$this->view->addScriptPath($layout->getLayoutPath() . $layout->getLayout() . "/templates/Flex/");
$this->init();
}
示例2: render
/**
* Render a hook's content
*
* @param string $name template to use
* @param string $module module to fetch template from
* @param string $controller controller to fetch template from, defaults to 'hooks'
*
* @return string Rendered content
*
*/
public function render($name, $module, $controller = "hooks")
{
$layout = Zend_Layout::getMvcInstance();
// Reset view script paths
$this->view->setScriptPath(null);
// Build new ones for hooks
$this->view->addBasePath(ZfApplication::$_base_path . "/app/{$module}/views", $module . "_View");
//$this->view->addScriptPath(ZfApplication::$_base_path."/app/$module/Views/");
$this->view->addScriptPath($layout->getLayoutPath() . "default/templates/{$module}");
$this->view->addScriptPath($layout->getLayoutPath() . $layout->getLayout() . "/templates/{$module}");
return $this->view->render($controller . "/" . $name);
}
示例3: addBasePath
/**
* Zend_View compatibility. Add the templates dir
*
* @see View/Zend_View_Abstract::addBasePath()
* @return Ext_View_Smarty
*/
public function addBasePath($path, $classPrefix = 'Zend_View')
{
parent::addBasePath($path, $classPrefix);
$this->addScriptPath($path . '/templates');
$this->addTemplateDir($path . '/templates/static');
return $this;
}
示例4: resetViewScripts
/**
* Reset the view's script paths and set new ones for use in the block
*
* @param Zend_View_Abstract $view
*/
private function resetViewScripts(Zend_View_Abstract $view)
{
$layout = Zend_Layout::getMvcInstance();
// Reset view script paths
$view->setScriptPath(null);
$module = ucfirst($this->module);
// Build new ones for blocks
$view->addBasePath(ZfApplication::$_base_path . "/app/{$module}/views", $module . "_View");
$view->addScriptPath(ZfApplication::$_base_path . "/app/{$module}/views/scripts/blocks");
$view->addScriptPath($layout->getLayoutPath() . "default/templates/blocks");
$view->addScriptPath($layout->getLayoutPath() . "default/templates/{$module}/blocks");
$view->addScriptPath($layout->getLayoutPath() . $layout->getLayout() . "/templates/blocks");
$view->addScriptPath($layout->getLayoutPath() . $layout->getLayout() . "/templates/{$module}/blocks");
}