Open-Source PHP Framework - Designed for rapid development of performance-oriented scalable applications

Layouts

API >> mvc >> layouts
  • default Default layout that is typically used on most pages
  • rss RSS layout

A layout operates like a view that is global to your application and wraps around all the other views. The intended purpose of a layout when outputting HTML (as opposed to XML, web services, etc.) is to unify the location of the page header and footer.
The layout gets a special variable $view that contains the contents of the view for the current page; you will typically need to echo this out somewhere in your layout.
echo $view;

Changing layouts

You can use a different layout by setting in your controller action:
mvc::$layout 'newLayout';
To skip loading of the layout altogether and just display the view as it is then set the mvc::$layout to false:
mvc::$layout false;

Vork standard layouts


  • default - most applications will be able to make use of this by adding a header, footer, menu, logo, etc .
  • rss - takes an array of data and produces a valid RSS feed