CatalystX::ListFramework

Foundations for displaying and editing lists (CRUD) in a Catalyst application
Download

CatalystX::ListFramework Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Andrew Payne
  • Publisher web site:
  • http://search.cpan.org/~snafufans/

CatalystX::ListFramework Tags


CatalystX::ListFramework Description

Foundations for displaying and editing lists (CRUD) in a Catalyst application CatalystX::ListFramework is a Perl module for displaying tabulated lists of database records, updating those records and creating new ones is a common task in Catalyst applications. This class supplies such lists, and forms to edit such records, to a set of templates, using simple definition files and your DBIx::Class Catalyst model. A search form is also supplied, which can include JSON-powered ExtJS comboboxes (see http://www.extjs.com/).SYNOPSIS package MyApp::Controller::Foo; use base 'Catalyst::Controller'; use CatalystX::ListFramework; sub listandsearch :Local { my ($self, $c, $kind) = @_; my $lf = CatalystX::ListFramework->new($kind, $c); my $restrict = {}; $lf->stash_listing('myview', 'myprefix', $restrict); $c->stash->{template} = 'list-and-search.tt'; } sub get :Local { my ($self, $c, $kind, $id) = @_; my $lf = CatalystX::ListFramework->new($kind, $c); $lf->stash_infoboxes({'me.id' => $id}); $c->stash->{kind} = $kind; $c->stash->{id} = $id; # the update form adds this to the URL $c->stash->{template} = 'detail.tt'; } sub update :Local { my ($self, $c, $kind, $id) = @_; my $lf = CatalystX::ListFramework->new($kind, $c); $lf->update_from_query({'me.id' => $id}); $c->res->redirect("/listandsearch/$kind"); } sub create :Local { my ($self, $c, $kind) = @_; my $lf = CatalystX::ListFramework->new($kind, $c); my $id = $lf->create_new; $c->res->redirect("/get/$kind/$id"); } Requirements: · Perl


CatalystX::ListFramework Related Software