2

这基本上是我的代码(简化):

class IndexController extends Zend_Controller_Action
{
    public function indexAction(){
        $this->view->setBasePath(APPLICATION_PATH . '/views/partner/xyz/');
        $this->view->render('node.phtml');
    }
}

现在我(显然)想要的是使用视图脚本APPLICATION_PATH . '/views/partner/xyz/node.phtml',但 ZF 总是尝试加载APPLICATION_PATH . '/views/partner/xyz/scripts/node.phtml'是否有任何解决该行为的方法?

4

2 回答 2

3

You can set the path to the view tih the setScriptPath method.

class IndexController extends Zend_Controller_Action
{
    public function indexAction(){
        $this->view->setScriptPath(APPLICATION_PATH.'/views/partner/xyz');
        //$this->view->setBasePath(APPLICATION_PATH . '/views/partner/xyz/');
        $this->view->render('node.phtml');
    }
}
于 2011-01-04T12:57:20.603 回答
0

I need to change the script path, not just view path:
public function setScriptPath($path);

于 2011-01-04T13:02:33.217 回答