| Catalyst-Enzyme documentation | Contained in the Catalyst-Enzyme distribution. |
Catalyst::Helper::Controller::Enzyme::CRUD - Helper for Catalyst::Enzyme CRUD Controllers
script/myapp/create.pl controller <CONTROLLER> Enzyme::CRUD <MODEL>
#Create BookShelf/Controller/Book.pm using the
#BookShelf/Model/BookShelfDB/Book.pm model
script\bookshelf_create.pl controller Book Enzyme::CRUD BookShelfDB::Book
Helper for Enzyme::Controller::CRUD Controller.
Makes tests for the CRUD Controller.
Catalyst::Enzyme::CRUD::Controller, Catalyst::Enzyme, Catalyst::Test, Catalyst::Helper,
Johan Lindstrom <johanl ÄT DarSerMan.com>
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
[% class %] - Catalyst Enzyme CRUD Controller
See [% app %]
Catalyst Enzyme Controller with CRUD support.
Define the model class for this Controller
[% author %]
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
| Catalyst-Enzyme documentation | Contained in the Catalyst-Enzyme distribution. |
package Catalyst::Helper::Controller::Enzyme::CRUD; our $VERSION = '0.10'; use strict;
sub mk_compclass { my ( $self, $helper, $model ) = @_; my $file = $helper->{file}; $model and $model = "$helper->{app}::Model::$model"; $helper->{model} = $model || ""; $helper->render_file( 'controller', $file ); return 1; } sub mk_comptest { my ($self, $helper) = @_; my $test = $helper->{'test'}; $helper->render_file('test', $test); };
1; __DATA__ __controller__ package [% class %]; use base 'Catalyst::Enzyme::CRUD::Controller'; use strict; use warnings;
sub model_class { return("[% model %]"); }
#Your actions here
1; __test__ use strict; use Test::More tests => 3; use_ok( 'Catalyst::Test', '[% app %]' ); use_ok('[% class %]'); ok( request('/[% uri %]')->is_success );