Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mason::filters::standard(3pm) [debian man page]

Mason::Filters::Standard(3pm)				User Contributed Perl Documentation			     Mason::Filters::Standard(3pm)

NAME
Mason::Filters::Standard - Standard filters DESCRIPTION
These filters are automatically composed into Mason::Component. FILTERS
Capture ($ref) Uses "$m->capture" to capture the content in $ref instead of outputting it. % $.Capture(my $content) {{ <!-- this will end up in $content --> % }} ... do something with $content CompCall ($path, @args...) Calls the component with path and @args, just as with "$m->scomp", with an additional coderef argument "yield" that can be invoked to generate the content. Arguments passed to "yield" can be accessed inside the content via @_. This is the replacement for Mason 1's Components With Content <http://search.cpan.org/perldoc?HTML::Mason::Devel#Component_Calls_with_Content>. In index.mc: % $.CompCall ('list_items.mi', items => @items) {{ <li><% $_[0] %></li> % }} In list_items.mi: <%class> has 'items'; has 'yield'; </%class> % foreach my $item (@{$.items}) { <% $.yield->($item) %> % } NoBlankLines Remove lines with only whitespace from content. This % $.NoBlankLines {{ hello world % }} yields hello world Repeat ($count) Repeat the content block $count times. Note that the block is re-executed each time, which may result in different content. <!-- Prints 1 to 5 --> % my $i = 1; % $.Repeat(5) {{ <% $i++ %><br> % }} Tee ($ref) Uses "$m->capture" to capture the content in $ref, and also output it. % $.Tee(my $content) {{ <!-- this will end up in $content and also be output --> % }} ... <!-- output content again down here --> <% $content %> Trim Remove whitespace from the beginning and end of the content. SEE ALSO
Mason::Manual::Filters, Mason 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. perl v5.14.2 2012-05-02 Mason::Filters::Standard(3pm)

Check Out this Related Man Page

Mason(3pm)						User Contributed Perl Documentation						Mason(3pm)

NAME
Mason - Powerful, high-performance templating for the web and beyond SYNOPSIS
foo.mc: % my $name = "Mason"; Hello world! Welcome to <% $name %>. #!/usr/local/bin/perl use Mason; my $mason = Mason->new(comp_root => '...'); print $mason->run('/foo')->output; DESCRIPTION
Mason is a powerful Perl-based templating system, designed to generate dynamic content of all kinds. Unlike many templating systems, Mason does not attempt to invent an alternate, "easier" syntax for templates. It provides a set of syntax and features specific to template creation, but underneath it is still clearly and proudly recognizable as Perl. Mason is most often used for generating web pages. It has a companion web framework, Poet, designed to take maximum advantage of its routing and content generation features. It can also be used as the templating layer for web frameworks such as Catalyst and Dancer. All documentation is indexed at Mason::Manual. The previous major version of Mason (1.x) is available under the name HTML::Mason. SUPPORT
The mailing list is "mason-users@lists.sourceforge.net". You must be subscribed to send a message. To subscribe, visit https://lists.sourceforge.net/lists/listinfo/mason-users <https://lists.sourceforge.net/lists/listinfo/mason-users>. You can also visit us at "#mason" on <irc://irc.perl.org/#mason>. Bugs and feature requests will be tracked at RT: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Mason bug-mason@rt.cpan.org The latest source code can be browsed and fetched at: http://github.com/jonswar/perl-mason git clone git://github.com/jonswar/perl-mason.git The official Mason website is <http://www.masonhq.com/>, however it contains mostly information about Mason 1. We're not sure what the future of the website will be wrt Mason 2. ACKNOWLEDGEMENTS
Thanks to Stevan Little and the Moose team for the awesomeness of Moose, which motivated me to create a second version of Mason years after I thought I was done. Thanks to Tatsuhiko Miyagawa and the PSGI/Plack <http://plackperl.org/> team, who freed me from ever worrying about server backends again. SEE ALSO
HTML::Mason 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. perl v5.14.2 2012-05-02 Mason(3pm)
Man Page