开发者

getting filename on Zend_View

开发者 https://www.devze.com 2023-03-28 04:49 出处:网络
Is it possible to get the filename of a pht开发者_如何学编程ml file that\'s been assign to Zend_View?

Is it possible to get the filename of a pht开发者_如何学编程ml file that's been assign to Zend_View?

For instance,

i've got this on my controller

$this->view = new Zend_View();

$this->view->setScriptPath(APPLICATION_PATH . "/views/scripts/"); $this->view->render('email/xxx.phtml');

the question is,

how do I get 'email/xxx.phtml' from the object?


you can use the ViewRenderer Helper, from your controller:

$viewRenderer = $this->_helper->viewRenderer;
$viewScript = $viewRenderer->getViewScript();

take a look at http://framework.zend.com/manual/en/zend.controller.actionhelpers.html#zend.controller.actionhelper.viewrenderer.basicusage

0

精彩评论

暂无评论...
验证码 换一张
取 消