开发者

How do I specify to Zend Framework to use a different view file than the action default file?

开发者 https://www.devze.com 2023-01-27 14:52 出处:网络
I have an acti开发者_如何学运维on, successAction(), it uses the file in my views folder, success.phtml, how do I tell the action that I want it to use the success2.phtml file insteadUse Zend_Controlle

I have an acti开发者_如何学运维on, successAction(), it uses the file in my views folder, success.phtml, how do I tell the action that I want it to use the success2.phtml file instead


Use Zend_Controller_Action's render. This would render the view script in controller-name/success2.phtml

class ControllerName_Controller_Action extends Zend_Controller_Action
{
    public function successAction()
    {
        $this->render("success2");
    }
}

You should read the docs on Zend Controller's for more.


$this->render('success2');
0

精彩评论

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