| CatalystX-CRUD-YUI documentation | Contained in the CatalystX-CRUD-YUI distribution. |
CatalystX::CRUD::YUI - YUI for your CatalystX::CRUD view
package MyApp::Controller::Foo;
use strict;
use base qw(
CatalystX::CRUD::YUI::Controller
CatalystX::CRUD::Controller::RHTMLO
);
# config here -- see CatalystX::CRUD::Controller docs
1;
CatalystX::CRUD::YUI is a crud application using the Yahoo User Interface and ExtJS toolkits, and CatalystX::CRUD components. It is derived largely from the Rose::DBx::Garden::Catalyst project but now with support for DBIx::Class via the CatalystX::CRUD::ModelAdapter::DBIC package.
The t/ test directly for this package contains two full Catalyst applications, one for RDBO and one for DBIC, both using the same basic db schema. Looking at those examples is a good way to start.
Only new or overridden method are documented here.
Returns a CatalystX::CRUD::YUI::LiveGrid object ready for the livegrid_*.tt templates.
opts should consist of:
results may be either a CatalystX::CRUD::Results object or a CatalystX::CRUD::Object object.
The Catalyst::Controller instance for the request.
The current Form object. The Form class should be Rose::HTMLx::Form::Related, a subclass thereof, or a class with a corresponding API.
If results is a CatalystX::CRUD::Object object, then a rel_info should be passed indicating which relationship to pull data from.
Optional arrayref of field names to include. Defaults to form->meta->field_methods().
Returns new Serializer object of type serializer_class().
Peter Karman, <karman@cpan.org>
Please report any bugs or feature requests to
bug-catalystx-crud-yui@rt.cpan.org, or through the web interface at
http://rt.cpan.org. I will be notified, and then you'll automatically be
notified of progress on your bug as I make changes.
The Minnesota Supercomputing Institute http://www.msi.umn.edu/
sponsored the development of this software.
Copyright 2008 by the Regents of the University of Minnesota.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| CatalystX-CRUD-YUI documentation | Contained in the CatalystX-CRUD-YUI distribution. |
package CatalystX::CRUD::YUI; use warnings; use strict; use Carp; use CatalystX::CRUD::YUI::LiveGrid; use CatalystX::CRUD::YUI::Serializer; use base qw( Class::Accessor::Fast ); use MRO::Compat; use mro "c3"; use Data::Dump qw( dump ); __PACKAGE__->mk_accessors( qw( serializer_class livegrid_class )); our $VERSION = '0.025';
sub new { my $self = shift->next::method(@_); $self->{serializer_class} ||= 'CatalystX::CRUD::YUI::Serializer'; $self->{livegrid_class} ||= 'CatalystX::CRUD::YUI::LiveGrid'; return $self; }
sub _fix_args { my @arg = @_; if ( @arg == 1 ) { if ( ref( $arg[0] ) eq 'ARRAY' ) { @arg = @{ $arg[0] }; } elsif ( ref( $arg[0] ) eq 'HASH' ) { @arg = %{ $arg[0] }; } } return @arg; } sub livegrid { my $self = shift; return $self->livegrid_class->new( _fix_args(@_), yui => $self ); }
sub serializer { my $self = shift; return $self->serializer_class->new( _fix_args(@_), yui => $self ); } 1; __END__