1 package Reaction::UI::Controller::Root;
3 use base qw/Reaction::UI::Controller/;
5 use Reaction::UI::Window;
9 content_type => 'text/html',
12 has 'view_name' => (isa => 'Str', is => 'rw');
13 has 'content_type' => (isa => 'Str', is => 'rw');
14 has 'window_title' => (isa => 'Str', is => 'rw');
17 my ($self, $ctx) = @_;
18 my $window :Stashed = Reaction::UI::Window->new(
20 view_name => $self->view_name,
21 content_type => $self->content_type,
22 title => $self->window_title,
24 my $focus_stack :Stashed = $window->focus_stack;
36 Reaction::UI::Root - Base component for the Root Controller
40 package MyApp::Controller::Root;
41 use base 'Reaction::UI::COntroller::Root';
44 $c->stash->{focus_stack}->push_viewport('Reaction::UI::ViewPort');
46 # Access the window title in a template:
51 Using this module as a base component for your L<Catalyst> Root
52 Controller provides automatic creation of a L<Reaction::UI::Window>
53 object containing an empty L<Reaction::UI::FocusStack> for your UI
54 elements. The stack is also resolved and rendered for you in the
63 =item Arguments: $viewname?
67 Set or retrieve the classname of the view used to render the UI.
73 =item Arguments: $contenttype?
77 Set or retrieve the content type of the page created.
83 =item Arguments: $windowtitle?
87 Set or retrieve the title of the page created.
91 See L<Reaction::Class> for authors.
95 See L<Reaction::Class> for the license.