Justin Hunter > Reaction-0.002002 > Reaction::Manual::Templates


Annotate this POD


New  1
Open  1
Stalled  1
View/Report Bugs
Source   Latest Release: Reaction-0.002005




This is a detailed description of reaction's template system.




Reaction's templates are organized into sets called skins. A skin is defined by a directory containing several template files and static assets. Skins live in directories under the share/skin path in your application distribution. Each directory and the template files within compose their own skin. Templates live in the layout directory and assets live in the web directory.

Core Skins

Reaction provides prebuilt skins called base and default. These provide the basic html components for a typical web application, such as forms, fields and table list views. Skins are extensible, which means you can include all the templates from another skin within your custom skin through a configuration directive instead of copying template files, making your template setup easy to maintain.

Configuration Directives

The share/skin/defaults.conf file holds general application-wide skin configuration. Each skin can be configured individually by placing a skin.conf file in it's root directory.


Template files are sets of pod-like directives which define a set of layouts. They are used for the sole purpose of describing how the data is to be layed out at render time. Each template file contains a set of layout definitions which are used by reaction widgets to generate the final content. Variables are defined and populated in the widgets then passed to the layout fragments in a given template file.

Template Directives



A layout definition creates a variable scope attached to that layout. Variables only exist within their specific layout fragments, that is, they are scoped to specific layouts. Overriding a layout places it in the same scope as the base layout.

Using layouts defined in base templates

The special [% call_next %] variable will be replaced by the layout in the base template within the same scope.

syntax highlighting: