YD8877
YD8877

Reputation: 10810

How do i load a certain view using zend framework?

I'm following the guide to load a view 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.

Upvotes: 1

Views: 2126

Answers (1)

ChrisA
ChrisA

Reputation: 2101

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.

Upvotes: 5

Related Questions