Chapter one provided a basic introduction to how a controller's action method displays its output in a view script of the same name. To review:
Given the URL http://localhost/blog/read/1 ...
blog is the controller
read is the action
1 is a parameter (multiple params may be passed)
This maps to ...
Which outputs to ...
Solar expects to find view scripts in predefined locations. The default directory structure for the Acme vendor with a single blog application looks like the following:
Acme/ App/ Blog/ Layout/ Locale/ Public/ View/ Blog.php Controller/ Bread/ Layout/ Locale/ Public/ View/ Page/ Layout/ Locale/ Public/ View/ Bread.php Page.php Model/ Sql/ Filter.php
It should be reasonably obvious from this structure where views and layouts are
expected to be found. The blog application expects to find its views and layouts
respectively. That is straighforward enough, however; if you open the
file in your favorite editor, you will notice that
Acme_App_Blog class extends
Acme_Controller_Page. This is important because it influences
the class stack; the hierarchy where Solar looks
for files. In this case, Solar first looks for views in
and if it doesn't find the required view there, it then looks in
The same goes for layouts. Keep this in mind as you proceed through this chapter.