container support built into fields and an example of usage in ComponentUI
[catagits/Reaction.git] / lib / ComponentUI / Controller / TestModel / Foo.pm
1 package ComponentUI::Controller::TestModel::Foo;
2
3 use base 'Reaction::UI::Controller::Collection::CRUD';
4 use Reaction::Class;
5
6 __PACKAGE__->config(
7   model_name => 'TestModel',
8   collection_name => 'Foo',
9   action => {
10     base => { Chained => '/base', PathPart => 'testmodel/foo' },
11     list => {
12       ViewPort => {
13         excluded_fields => [qw/id/],
14       },
15     },
16     view => {
17       ViewPort => {
18         excluded_fields => [qw/id/],
19       },
20     },
21   },
22 );
23
24 for my $action (qw/view create update/){
25   __PACKAGE__->config(
26     action => {
27       $action => {
28         ViewPort => {
29           container_layouts => [
30             { name => 'primary', fields => [qw/first_name last_name/]},
31             {
32               name => 'secondary',
33               label => 'Optional Label',
34               fields => [qw/bars bazes/],
35             },
36           ],
37         },
38       },
39     }
40   );
41 }
42
43 1;