NAME
Reaction::UI::Controller::Root - Base component for the Root Controller
SYNOPSIS
package MyApp::Controller::Root;
use base 'Reaction::UI::Controller::Root';
__PACKAGE__->config(
view_name => 'Site',
window_title => 'Reaction Test App',
namespace => ''
);
# Create UI elements:
$c->stash->{focus_stack}->push_viewport('Reaction::UI::ViewPort');
# Access the window title in a template:
[% window.title %]
DESCRIPTION
Using this module as a base component for your Catalyst Root Controller provides automatic creation of a Reaction::UI::Window object containing an empty Reaction::UI::FocusStack for your UI elements. The stack is also resolved and rendered for you in the end
action.
At the begin
of each request, a Reaction::UI::Window object is created using the configured "view_name", "content_type" and "window_title". These thus should be directly changed on the stashed window object at runtime, if needed.
METHODS
view_name
Set or retrieve the classname of the view used to render the UI. Can also be set by a call to config. Defaults to 'XHTML'.
content_type
Set or retrieve the content type of the page created. Can also be set by a call to config or in a config file. Defaults to 'text/html'.
window_title
Set or retrieve the title of the page created. Can also be set by a call to config or in a config file. No default.
AUTHORS
See Reaction::Class for authors.
LICENSE
See Reaction::Class for the license.