Group
Extension

Matches 4

Frame ( C/CR/CRABAPP/Frame-0.01.5-TRIAL.tar.gz, CRABAPP, 2025; MetaCPAN )
Frame/lib/Frame/Request.pm ( view source; MetaCPAN )
t::Util 'any';
use Hash::Util 'lock_hashref_recurse';

use constant JSONSTR => 'application/json';
use constant JSONRE => qr/^${\JSONSTR}/;
use constant XHRRE => qr/^XMLHttpRequest$/i;

our @ajax_head
0]) ? 1 : 0
}

method maybe_ajax (@headers) {
  $self->is_xhr
    || $self->env->{HTTP_ACCEPT} =~ JSONRE
    || any { $self->header($_) } (@ajax_headers, @headers)
}

method is_xhr { ($self->header('X
Frame ( C/CR/CRABAPP/Frame-0.01.5-TRIAL.tar.gz, CRABAPP, 2025; MetaCPAN )
Frame/lib/Frame/Db/Model.pm ( view source; MetaCPAN )
  $$column{type} //= 'TEXT';

        $$column{sql_type} = 'TEXT'
          if $$column{type} eq 'JSON';

        $$column{sql_type} = 'INTEGER'
          if $$column{type} eq 'Time::Moment';

       
Frame ( C/CR/CRABAPP/Frame-0.01.5-TRIAL.tar.gz, CRABAPP, 2025; MetaCPAN )
Frame/lib/Frame/Base.pm ( view source; MetaCPAN )
y);
use JSON::MaybeXS;
use Data::Dumper;
use Time::Piece;
use Plack::Util;
use Module::Metadata;
use Syntax::Keyword::Dynamically;
use Syntax::Keyword::Try;

our @EXPORT         = qw(dmsg json __pkgfn
 } @ENV{qw'FRAME_DEBUG DEBUG'};

#sub _json_default {
#    JSON::MaybeXS->new( utf8 => 1, $dev_mode ? ( pretty => 1 ) : () );
#}

const our $json_default => JSON::MaybeXS->new( utf8 => 1, $DEV_MODE ? 
RT_DOES;

$^H{ __PACKAGE__ . '/user' } = 1;

field $app : weak : param : accessor = undef;
field $json;
field $debug_mode :param :accessor = $DEBUG_MODE;
field $dev_mode :param :accessor = $DEV_MODE;
Frame ( C/CR/CRABAPP/Frame-0.01.5-TRIAL.tar.gz, CRABAPP, 2025; MetaCPAN )
Frame/lib/Frame/Controller.pm ( view source; MetaCPAN )
ontroller : does(Frame::Base);

use utf8;
use v5.40;

use Carp;
use Encode;
use Text::Xslate;
use JSON::MaybeXS;
use Feature::Compat::Try;
use Frame::Request;
use Const::Fast;

const our @EXPORT_DOES 

        $content_type ||= "application/json; charset=$opts{charset}";

        try {
            $res->content_type($content_type);
            $res->body( json->encode($content) )
        }
        
s => $status, msg => $content }
      if ( $content_type // $req->maybe_ajax ) =~ Frame::Request::JSONRE;

    $self->render( $content, $status, $content_type, @args );
}

method render_500 ( $content

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