https://github.com/monken/p5-catalystx-extjs-direct
Enable Ext.Direct in Catalyst controllers
https://github.com/monken/p5-catalystx-extjs-direct
Last synced: 4 months ago
JSON representation
Enable Ext.Direct in Catalyst controllers
- Host: GitHub
- URL: https://github.com/monken/p5-catalystx-extjs-direct
- Owner: monken
- Created: 2011-02-05T17:54:34.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2016-09-21T22:22:23.000Z (almost 9 years ago)
- Last Synced: 2025-01-29T05:13:38.594Z (5 months ago)
- Language: Perl
- Homepage:
- Size: 1.08 MB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.pod
- Changelog: Changes
Awesome Lists containing this project
README
package CatalystX::ExtJS::Direct;
# ABSTRACT: Enable Ext.Direct in Catalyst controllers1;
__END__
=head1 SYNOPSIS
package MyApp::Controller::API;
use Moose;
extends 'CatalystX::Controller::ExtJS::Direct::API';package MyApp::Controller::Calculator;
use Moose;
BEGIN { extends 'Catalyst::Controller' };
with 'CatalystX::Controller::ExtJS::Direct';
sub sum : Local : Direct : DirectArgs(1) {
my ($self, $c) = @_;
$c->res->body( $c->req->param('a') + $c->req->param('b') );
}
1;In your web application:
// Load ExtJS classes here
Ext.Direct.addProvider(Ext.app.REMOTING_API);
Calculator.sum({ a: 1, b: 2 }, function(result) {
alert(result);
});
=head1 DESCRIPTION
This module makes the transition to Ext.Direct dead simple.
Have a look at the L
which gives you a few examples on how to use this module.L is responsible for
providing the API to the ExtJS application. Some configuration
can be done here.=head1 SEE ALSO
=over 4
=item L
Parent namespace. Includes examples and the code for the tutorial.
=item L
Add feature-rich REST controllers to your application.
=back