-
-
10 Mar 2011 19:24:24 UTC
- Distribution: Catalyst-View-Mason2
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues (1)
- Testers (600 / 5 / 0)
- Kwalitee
Bus factor: 0- % Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (11.5KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- VIEW CONFIGURATION
- MASON CONSTRUCTOR
- GLOBALS
- METHODS
- AUTHOR
- COPYRIGHT AND LICENSE
NAME
Catalyst::View::Mason2 - Mason 2.x view class
VERSION
version 0.03
SYNOPSIS
# use the helper script/create.pl view Mason2 Mason2 # lib/MyApp/View/Mason2.pm package MyApp::View::Mason2; use base 'Catalyst::View::Mason2'; __PACKAGE__->config( # insert Mason parameters here ); 1; # in a controller package MyApp::Controller::Foo; sub bar : Local { ... $c->stash->{name} = 'Homer'; $c->stash->{template} = 'foo/bar'; # .mc is automatically added } # in root/comps/foo/bar.mc <%args> $.name </%args> Hello <% $.name %>! Your URI was <% $c->req->uri %>.
DESCRIPTION
Allows you to use Mason 2.x for your views.
VIEW CONFIGURATION
- mason_root_class
-
Class to use for creating the Mason object. Defaults to 'Mason'.
MASON CONSTRUCTOR
Other than any special mentioned keys above, the configuration for this view will be passed directly into
Mason->new
.There are a few defaults specific to this view:
- comp_root
-
If not provided, defaults
$c->path_to('root', 'comps')
. - data_dir
-
If not provided, defaults
$c->path_to('data')
. - allow_globals
-
Automatically includes
$c
.
All other defaults are standard Mason.
GLOBALS
All components have access to
$c
, the current Catalyst context.METHODS
- process ($c)
-
Renders the component specified in
$c->stash->{template}
or, if not specified,$c->action
.The component path is prefixed with a '/' if it does not already have one, and Mason will automatically add a ".mc" extension - to change the latter, you can use
__PACKAGE__->config( autoextend_request_path => 0 );
Request arguments are taken from
$c->stash
. - render ($c, $path, \%args)
-
Renders the component
$path
with\%args
, and returns the output.
AUTHOR
Jonathan Swartz <swartz@pobox.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Catalyst::View::Mason2, copy and paste the appropriate command in to your terminal.
cpanm Catalyst::View::Mason2
perl -MCPAN -e shell install Catalyst::View::Mason2
For more information on module installation, please visit the detailed CPAN module installation guide.