Catalyst::View::Haml - Haml View Class for Catalyst
New to Haml? Check out http://haml-lang.com/tutorial.html. This module lets you create a Haml view for your Catalyst application:
package MyApp::View::Web; use Moose; extends 'Catalyst::View::Haml'; # ...your custom code here... 1;
or use the helper to create it for you:
myapp_create.pl view Web Haml
then you can write your templates in Haml!
#content .left.column %h2 Welcome to our site! %p= $information .right.column = $item->{body}
If you want to omit sigils in your Haml templates, just set the 'vars_as_subs' option:
package MyApp::View::Web; use Moose; extends 'Catalyst::View::Haml'; has '+vars_as_subs', default => 1; 1;
this way the Haml template above becomes:
#content .left.column %h2 Welcome to our site! %p= information .right.column = item->{body}
You may specify the following configuration items in from your config file or directly on the view object.
The name used to refer to the Catalyst app object in the template
The suffix used to auto generate the template name from the action name (when you do not explicitly specify the template filename); Defaults to '.haml'
The charset used to output the response body. The value defaults to 'UTF-8'.
Array reference specifying one or more directories in which template files are located. Defaults to your application's "root" directory.
Sets Haml output format. Can be set to 'xhtml', 'html' or 'html5'. Defaults to 'xhtml'.
When set to true, Perl variables become lvalue subroutines, so you can use them in you Haml templates without sigils. Default is false.
Switch on/off Haml output html escaping. Default is on.
CACHE (!)
filters
helpers
Missing Text::Haml options
Breno G. de Oliveira, <garu at cpan.org>
<garu at cpan.org>
Please report any bugs or feature requests to bug-catalyst-view-haml at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-View-Haml. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-catalyst-view-haml at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Catalyst::View::Haml
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Catalyst-View-Haml
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Catalyst-View-Haml
CPAN Ratings
http://cpanratings.perl.org/d/Catalyst-View-Haml
Search CPAN
http://search.cpan.org/dist/Catalyst-View-Haml/
Viacheslav Tykhanovskyi (vti) for his awesome Text::Haml implementation of Haml, the entire Haml and Catalyst teams of devs, and Daisuke Maki (lesterrat) for Catalyst::View::Xslate, from which lots of this code was borrowed (sometimes nearly verbatim).
Copyright 2010 Breno G. de Oliveira.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Catalyst::View::Haml, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::Haml
CPAN shell
perl -MCPAN -e shell install Catalyst::View::Haml
For more information on module installation, please visit the detailed CPAN module installation guide.