Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Enable Ext.Direct in Catalyst controllers

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 Changes
Octocat-spinner-32 README.pod
Octocat-spinner-32 dist.ini
README.pod

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
  <script type="text/javascript" src="/api/src"></script>
  <script>
    Ext.Direct.addProvider(Ext.app.REMOTING_API);
    Calculator.sum({ a: 1, b: 2 }, function(result) {
        alert(result);
    });
  </script>

DESCRIPTION

This module makes the transition to Ext.Direct dead simple.

Have a look at the tutorial which gives you a few examples on how to use this module.

CatalystX::Controller::ExtJS::Direct::API is responsible for providing the API to the ExtJS application. Some configuration can be done here.

SEE ALSO

CatalystX::ExtJS

Parent namespace. Includes examples and the code for the tutorial.

CatalystX::ExtJS::REST

Add feature-rich REST controllers to your application.

Something went wrong with that request. Please try again.