NAME

Egg::View::Mason - HTML::Mason is used for View of Egg.

SYNOPSIS

This is a setting example.

 VIEW=> [
   [ 'Mason' => {
     comp_root=> [
       [ main   => '/path/to/root' ],
       [ private=> '/path/to/comp' ],
       ],
     data_dir=> '/path/to/temp',
     ... etc.
     } ],
   ],

Example of code.

 $e->stash->{param1}= "fooooo";
 
 $e->view->param( 'param2'=> 'booooo' );
 
 # Scalar reference is received.
 my $body= $e->view->render( 'template.tt' );
 
   or
 
 # It outputs it later.
 $e->template( 'template.tt' );

Example of template.

 <& /comp/html_header, a=> { page_title=> 'test-page' } &>
 <& /comp/banner_head, a=> { type => 1 } &>
 <& /comp/side_menu,   a=> { guest=> 1 } &>
 
 <h1><% $e->stash->{param1} %></h1>
 
 <h2><% $p->{param2} %></h2>
 
 <%init>
 my $array= [
   { name=> 'foo', value=> 'foofoofoo' },
   { name=> 'baa', value=> 'baabaabaa' },
   { name=> 'baa', value=> 'baabaabaa' },
   ];
 </%init>
 <div id="content">
 - Your request passing: <% $e->request->path |h %><hr>
 - Your IP address: <% $e->request->address |h %><hr>
 - Test Array:
 %
 % for my $hash (@$array) {
  [ <% $hash->{name} |h %> = <% $hash->{value} |h %> ],
 % }
 %
 </div>
 <& /comp/html_footer &>

!! It solves it by <% $e->escape_html($var) %> when garbling in <% $var |h %>.

DESCRIPTION

The following global variable can be used.

  • $e = Egg object.

  • $p = $e->view->params.

SEE ALSO

HTML::Mason, Egg::View, Egg::Component, Egg::Release,

AUTHOR

Masatoshi Mizuno, <mizuno@bomcity.com>

COPYRIGHT AND LICENSE

Copyright (C) 2006 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.