-
-
12 Jul 2009 23:01:57 UTC
- Distribution: Catalyst-ActionRole-FindViewByIsa
- Module version: 0.000002
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (165 / 16 / 0)
- Kwalitee
Bus factor: 9- License: perl_5
- Activity
24 month- Tools
- Download (17.19KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Catalyst::ActionRole::FindViewByIsa - Select from the available application views by type
SYNOPSIS
package MyApp::Controller::Foo; use Moose; BEGIN { extends 'Catalyst::Controller::ActionRole'; } sub foo : Local Does('FindViewByIsa') FindViewByIsa('Catalyst::View::TT') { # Code here. If $c->stash->{current_view} is set, it will be left alone # after this method is run. Otherwise it will be set to # the first app view which @ISA Catalyst::View::TT }
DESCRIPTION
If you are trying to write a generic controller component which will be reused within an application, you do not want to mandate the use of one type of view, but if you're providing templates with your component, then you need to be able to find a view of the appropriate type.
Therefore this action role will select a the view in the application which matches the class of view that you want, no matter what it is named locally within the application.
AUTHOR
Tomas Doran (t0m),
<bobtfish@bobtfish.net>
COPYRIGHT & LICENSE
Copyright 2009 Tomas Doran, some rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Catalyst::ActionRole::FindViewByIsa, copy and paste the appropriate command in to your terminal.
cpanm Catalyst::ActionRole::FindViewByIsa
perl -MCPAN -e shell install Catalyst::ActionRole::FindViewByIsa
For more information on module installation, please visit the detailed CPAN module installation guide.