Catalyst::Controller::CRUD::DBIC - Implementation for Catalyst::Controller::CRUD


Catalyst-Plugin-CRUD documentation  | view source Contained in the Catalyst-Plugin-CRUD distribution.

Index


NAME

Top

Catalyst::Controller::CRUD::DBIC - Implementation for Catalyst::Controller::CRUD

SYNOPSIS

Top

MyApp/lib/MyApp.pm

  package MyApp;

  use Catalyst qw/-Debug I18N CRUD Static::Simple/;

  1;

MyApp/lib/MyApp/Controller/User.pm

  package MyApp::Controller::User;

  use base 'Catalyst::Controller';
  use Class::Trigger;

  sub setting {
      my ( $self, $c ) = @_;
      my $hash = {
          'name'     => 'user',
          'type'     => 'DBIC',
          'model'    => 'DBIC::UserMaster',
          'primary'  => 'id',
          'columns'  => [qw(name phone mail)],
          'default'  => '/user/list',
          'template' => {
              'prefix' => 'template/user/',
              'suffix' => '.tt'
          },
      };
      return $hash;
  }

  sub create : Local {
    my ( $self, $c ) = @_;
    $c->create($self);
  }

  1;

DESCRIPTION

Top

This module implements DBIx::Class depend interfaces for Catalyst::Controller::CRUD.

 - get_model
 - get_models

EXPORT

None by default.

METHODS

Top

get_model($this,$c,$self,$id)

This method returns model object having $id.

Triggers:

 $self->call_trigger( 'get_model_after', $c, $hash );

get_models($this,$c,$self)

This method returns model objects.

SEE ALSO

Top

Catalyst::Controller::CRUD, DBIx::Class

AUTHOR

Top

Jun Shimizu, <bayside@cpan.org>

COPYRIGHT AND LICENSE

Top


Catalyst-Plugin-CRUD documentation  | view source Contained in the Catalyst-Plugin-CRUD distribution.