Group
Extension

Matches 5

CatalystX-ExtJS-Direct ( P/PE/PERLER/CatalystX-ExtJS-Direct-2.1.5.tar.gz, PERLER, 2014; MetaCPAN )
CatalystX-ExtJS-Direct/lib/CatalystX/ExtJS/Tutorial/Direct.pm ( view source; MetaCPAN )
;
 BEGIN { extends 'Catalyst::Controller' };
 with 'CatalystX::Controller::ExtJS::Direct';
 
 use JSON::XS;

 sub add : Chained('/') : Path : CaptureArgs(1) {
    my($self,$c, $arg) = @_;
    $c->stas
: DirectArgs(1) {
    my ($self, $c) = @_;
    $c->res->content_type('application/json');
    $c->res->body(encode_json($c->req->data));
 }

As you can see the C<add_to> action has the C<Direct> attri
 which is always an arrayref and includes all arguments.
We set the content type to C<application/json> to make sure that the
body is not serialized twice. That is, if you would not set the content ty
CatalystX-ExtJS-Direct ( P/PE/PERLER/CatalystX-ExtJS-Direct-2.1.5.tar.gz, PERLER, 2014; MetaCPAN )
CatalystX-ExtJS-Direct/lib/CatalystX/Controller/ExtJS/Direct/Route.pm ( view source; MetaCPAN )
 },
        accepted_content_types => ['application/json'],
        content_types => ['application/json'],
        content_type => 'application/json'
    );

};

# split a request in multiple requests
CatalystX-ExtJS-Direct ( P/PE/PERLER/CatalystX-ExtJS-Direct-2.1.5.tar.gz, PERLER, 2014; MetaCPAN )
CatalystX-ExtJS-Direct/lib/CatalystX/Action/ExtJS/Deserialize.pm ( view source; MetaCPAN )
  $c->req->is_ext_upload )
    {
        unshift(@{$c->req->accepted_content_types}, 'application/json');
        return 1;
    }
    else {
        return $self->next::method( $controller, $c );
    
CatalystX-ExtJS-Direct ( P/PE/PERLER/CatalystX-ExtJS-Direct-2.1.5.tar.gz, PERLER, 2014; MetaCPAN )
CatalystX-ExtJS-Direct/lib/CatalystX/Controller/ExtJS/Direct/API.pm ( view source; MetaCPAN )
dAttributes;

use List::Util qw(first);
use List::MoreUtils ();
use Scalar::Util qw(blessed);
use JSON ();
use CatalystX::Controller::ExtJS::Direct::Route;

__PACKAGE__->config(
    
    action => {
 
     => 'router' },
        src    => { Local => undef },
    },
    
    default => 'application/json'
    
);


has 'api' => ( is => 'rw', lazy_build => 1 );

has 'routes' => ( is => 'rw', isa => 'H

        actions => $data
    };
}

sub encoded_api {
    my ( $self, $c ) = @_;
    return JSON::encode_json( $self->set_namespace( $self->api, $c ? $c->req->params->{namespace} : () ) );
}

sub rout
CatalystX-ExtJS-Direct ( P/PE/PERLER/CatalystX-ExtJS-Direct-2.1.5.tar.gz, PERLER, 2014; MetaCPAN )
CatalystX-ExtJS-Direct/lib/CatalystX/TraitFor/Request/ExtJS.pm ( view source; MetaCPAN )
CT: Sets the request method via a query parameter
use Moose::Role;

use namespace::autoclean;
use JSON::XS;

#has 'is_ext_upload' => ( isa => 'Bool', is => 'rw', lazy_build => 1 );

sub is_ext_upload 
^multipart\/form-data/
      && ( !$self->{content_type} || $self->{content_type} ne 'application/json');
}

around 'method' => sub {
    my ( $orig, $self, $method ) = @_;
    return $self->$orig($me

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.