Skip to content
LaCodon edited this page Dec 15, 2015 · 1 revision

After the Controller and the Action were executed, a certain View, depending on the Controller and Action, will get called.

Contents

Save path and filename

Every View has a special filename and save path. The filename has to match the name of the Action, e.g. the Action indexAction() will call a View file named index.php and so on.

It's important to store the view file in a subfolder of your /view folder! This folder has to share its name with the one of the called Controller in lower case letters, e.g.: all Views for the Controller IndexController should be stored in a subfolder called index and so on.

View file content

The content of a View file depends on its purpose. Every content which you place in the View file will later be rendered inside the HTML <body> tags unless you call $this->_view->turnLayoutOff(); in the Action. You have then the possibility to completely create an own HTML structure. This may be useful for a custom 404 page.