开发者

How do i load a certain view using zend framework?

开发者 https://www.devze.com 2023-03-30 22:45 出处:网络
I\'m following the guide to load a v开发者_StackOverflowiew as in this link : http://framework.zend.com/manual/en/zend.view.introduction.html

I'm following the guide to load a v开发者_StackOverflowiew as in this link : http://framework.zend.com/manual/en/zend.view.introduction.html

However, I'm not sure where to keep the booklist.php file that is the view file to be loaded. So, I kept it inside the /views folder (outside the scripts folder)

But, I'm getting this error :

An error occurred

Application error

Please help.


There is this question in the comments at the bottom of that page. 'Steve' says:

You have to tell it where to find the view script:

so create the booklist.php file in application/views/scripts/books and insert the line:

$view->setScriptPath(APPLICATION_PATH.'/views/scripts/books');

after

$view = new Zend_View();

in your controller script.

0

精彩评论

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

关注公众号