Amon2-MobileJP

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

# =========================================================================
# THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA.
# DO NOT EDIT DIRECTLY.
# =========================================================================

use 5.008_001;

use strict;
use warnings;
use utf8;

use Module::Build;
use File::Basename;
use File::Spec;
use CPAN::Meta;
use CPAN::Meta::Prereqs;

my %args = (
    license              => 'perl',
    dynamic_config       => 0,

lib/Amon2/MobileJP.pm  view on Meta::CPAN

package Amon2::MobileJP;
use strict;
use warnings;
use utf8;
use 5.008_001;

our $VERSION = '0.11';

1;
__END__

=head1 NAME

Amon2::MobileJP - Amon2 plugins set for Japanese mobile phones

lib/Amon2/Plugin/Web/MobileAgent.pm  view on Meta::CPAN

        'mobile_agent',
        sub {
            $_[0]->{mobile_agent} ||= HTTP::MobileAgent->new($_[0]->req->headers);
        }
    );
}

1;
__END__

=encoding utf8

=head1 NAME

Amon2::Plugin::Web::MobileAgent - HTTP::MobileAgent plugin for Amon2

=head1 SYNOPSIS

    package MyApp::Web;
    use parent qw/MyApp Amon2::Web/;
    __PACKAGE__->load_plugins('Web::MobileAgent');

lib/Amon2/Plugin/Web/MobileCharset.pm  view on Meta::CPAN

use HTTP::MobileAgent::Plugin::Charset;
use Encode::JP::Mobile 0.29;
use Amon2::Util;

sub init {
    my ($class, $c, $conf) = @_;

    Amon2::Util::add_method($c, 'html_content_type' => sub {
        my $ma = shift->mobile_agent;
        my $ct  = $ma->is_docomo ? 'application/xhtml+xml;charset=' : 'text/html;charset=';
           $ct .= $ma->can_display_utf8 ? 'utf-8' : 'Shift_JIS';
           $ct;
    });

    Amon2::Util::add_method($c, 'encoding' => sub {
        shift->mobile_agent->encoding
    });
}

1;
__END__



( run in 1.128 second using v1.01-cache-2.11-cpan-49f99fa48dc )