NAME

Catalyst::View::TextForge - Text::Forge View Class

SYNOPSIS

  # use the helper
  script/create.pl view TextForge TextForge

  # lib/MyApp/View/TextForge.pm
  package MyApp::View::TextForge;

  use base qw/ Catalyst::View::TextForge /;

  # Set search path for templates (default: $c->config->{root})
  # __PACKAGE__->config->{root} = '/path/to/template/root';

  # Set cache mode (default: 1); See Text::Forge for details 
  # __PACKAGE__->config->{cache} = 2;

  1;

DESCRIPTION

Use Text::Forge templates as Catalyst views.

Text::Forge templates are very similar to ERB/ASP/PHP in syntax. See the Text::Forge module for details.

Templates are passed two parameters, the stash and the Catalyst object itself.

Example template:

<% my $s = shift; # now contains $c->stash %>
<h1>Hello, <%= $s->{name} %><h1>
<p>
  The current time is <%= scalar localtime %>.
</p>

The catalyst object can also be obtained through $forge->catalyst() from any template.

SEE ALSO

Catalyst, Text::Forge

AUTHOR

Maurice Aubrey maurice@cpan.org

COPYRIGHT

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.