Irawana Lakmal
Irawana Lakmal

Reputation: 31

Zend tries to load incorrect layouts

We set up the layout in the bootstrap.php as follows.

Zend_Layout::startMvc(array(
    'layoutPath' => '../application/views/scripts/index/',
    'layout' => 'wrapper'
));

When we first access some pages, Zend is trying to load an incorrect layout script. After that it's loading the correct layout.

eg. When we visit to the stores page it's trying to load the /application/views/scripts/index/stores.phtml. But there is no such script. Then it's loading the correct layout and working fine.

Upvotes: 0

Views: 89

Answers (1)

codingjoe
codingjoe

Reputation: 1257

I think you're confusing layouts and views.

Layouts are usually not stored in views/scripts.

If you are loading a controller, Zend's MVC looks for the right view. If non is found it returns an error unless you disable the view in the controller.

I think you should take a closer look at http://framework.zend.com/manual/1.12/en/learning.quickstart.create-layout.html

You should also considere to use zf 'tool' to setup your project. That should save you time and pain.

If you want a more detailed answer you should provide more detail about your project setup and some error messages.

Upvotes: 2

Related Questions