The View layer of Wireframe consists of a set of interconnected components:
- The View class is a wrapper for the ProcessWire TemplateFile class with some additional features and the Wireframe namespace. By default Wireframe makes an instance of the View class available as API variable $view, and it is through this object that you typically pass data from Controllers to layout, view, and partial files.
- Layouts are the "frames" for your website, typically consisting of elements that remain mostly identical from page to page: header, footer, site navigation, and so on. You can have more than one layout, or you might have none if that makes sense in your use case. You can change or disable a layout for a specific template or page programmatically.
- View Placeholders are used to inject content from views or Controllers to layouts.
- Views (or sometimes view files) are specific to a single template, and used to render a page using that template. Each template may have more than one view – or none at all, if that page is not intended to be viewable on your site (or if you're using some other solution to render its contents).
- Partials are reusable blocks of content, that you want to share between multiple templates. Things like a shared navigation, breadcrumbs, or perhaps a search form are typical use cases for partials. As a rule of thumb: if you need the same block on at least two separate occasions in different layouts or views, it probably should be a partial.
- Components are a newer addition that achieves many of the same goals as partials, providing support for reusable content blocks, but due to their class based architecture they are slightly more advanced, and also provide handy features for separating code from markup, handling parameters, etc.