| Mason::Filters::Standard(3pm) | User Contributed Perl Documentation | Mason::Filters::Standard(3pm) |
Mason::Filters::Standard - Standard filters
These filters are automatically composed into Mason::Component.
% $.Capture(\my $content) {{
<!-- this will end up in $content -->
% }}
... do something 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 {{
hello
world
% }}
yields
hello
world
<!-- Prints 1 to 5 -->
% my $i = 1;
% $.Repeat(5) {{
<% $i++ %><br>
% }}
% $.Tee(\my $content) {{
<!-- this will end up in $content and also be output -->
% }}
...
<!-- output content again down here -->
<% $content %>
Mason::Manual::Filters, Mason
Jonathan Swartz <swartz@pobox.com>
This software is copyright (c) 2012 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.
| 2022-05-27 | perl v5.34.0 |