MooseX::Templated::View - Interface for MooseX::Templated views
package MooseX::Templated::View::MyRenderer; use Moose; use My::Renderer; with 'MooseX::Templated::View'; my %CONFIG = ( FOO => 1 ); sub build_default_template_suffix { '.tpl' } sub build_renderer { My::Renderer->new( option => 1 ) } # return rendered output as string sub process { my $self = shift; # instantiated from view_class and view_config my $view = $self->view; # source will be provided by defaults my $source = $self->source; # get rendered output from backend my $output = $engine->some_render_method( src => $source, stash => { self => $self }, ); return $output; }
The individual view needs to implement this method to actually process the template.
This role provides a general interface for backend template systems (e.g. MooseX::Templated::View::TT)
None reported.
No bugs have been reported.
Please report any bugs or feature requests to bug-moosex-templated@rt.cpan.org, or through the web interface at http://rt.cpan.org.
bug-moosex-templated@rt.cpan.org
Chris Prather (perigrin)
Ian Sillitoe <isillitoe@cpan.org>
<isillitoe@cpan.org>
Copyright (c) 2008, Ian Sillitoe <isillitoe@cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install MooseX::Templated, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Templated
CPAN shell
perl -MCPAN -e shell install MooseX::Templated
For more information on module installation, please visit the detailed CPAN module installation guide.