Catalyst::Helper::Controller::Enzyme::CRUD - Helper for


Catalyst-Enzyme documentation Contained in the Catalyst-Enzyme distribution.

Index


Code Index:

NAME

Top

Catalyst::Helper::Controller::Enzyme::CRUD - Helper for Catalyst::Enzyme CRUD Controllers

SYNOPSIS

Top

    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







DESCRIPTION

Top

Helper for Enzyme::Controller::CRUD Controller.

METHODS

mk_compclass
mk_comptest

Makes tests for the CRUD Controller.

SEE ALSO

Top

Catalyst::Enzyme::CRUD::Controller, Catalyst::Enzyme, Catalyst::Test, Catalyst::Helper,

AUTHOR

Top

Johan Lindstrom <johanl ÄT DarSerMan.com>

LICENSE

Top

This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.

NAME

Top

[% class %] - Catalyst Enzyme CRUD Controller

SYNOPSIS

Top

See [% app %]

DESCRIPTION

Top

Catalyst Enzyme Controller with CRUD support.

METHODS

Top

model_class

Define the model class for this Controller

ACTIONS

Top

SEE ALSO

Top

[% app %], Catalyst::Enzyme::CRUD::Controller, Catalyst::Enzyme

AUTHOR

Top

[% author %]

LICENSE

Top

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 );