aboutsummaryrefslogtreecommitdiffstats
path: root/old/Manual/Cookbook.pod
blob: e04c6ee91179a82b4d24cade2176bf3a600ef1d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
=head1 NAME

Reaction::Manual::Cookbook - Miscellaneous recipes

=head1 RECIPES

These should include some hopefully useful tips and tricks!

=head2 Display

These would typically go in your /root directory along with your other
templates.

=head3 Alternating listview row styles with CSS

Filename: listview

  [%
  
  PROCESS base/listview;
  
  row_block = 'listview_row_fancy';
  
  BLOCK listview_row_fancy;
  
    IF loop.count % 2 == 1;
      attrs.class = 'dark';
    ELSE;
      attrs.class = 'light';
    END;
  
    INCLUDE listview_row;
  
  END;
  
  %]

=head3 Displaying heading on action forms

Filename: form_base

  [%
  
  PROCESS base/form_base;
  
  main_block = 'form_base_control_fancy';
  
  BLOCK form_base_control_fancy;
  
    action_class = self.action.meta.name.split('::').pop;
    '<h3>'; action_class.split('(?=[A-Z])').join(' '); '</h3>';
    INCLUDE form_base_control;
  
  END;
  
  %]

=head2 Controllers

Things

=head2 Models

Stuff

=head1 AUTHORS

See L<Reaction::Class> for authors.

=head1 LICENSE

See L<Reaction::Class> for the license.

=cut