NAME
Mojolicious::Plugin::Mobi - Mojolicious Plugin
SYNOPSIS
# Mojolicious
$self->plugin('Mobi');
$self->routes->route("/")->over(mobile=>1)->to("Mobile#index");
# or
$self->render(text=>"You are mobile.") if $self->is_mobile;
# Mojolicious::Lite - not tested this way
plugin 'Mobi';
get '/' => sub {
if (is_mobile()) {
redirect_to("http://m.example.com");
}
}
# or
get '/' => (mobile=>1) => sub {
my $self = shift;
$self->render(text=>"This is a mobile version of this site.");
};
DESCRIPTION
Mojolicious::Plugin::Mobi is a Mojolicious plugin. This module provides a helper method is_mobile and route condition to be more easy to use in your dispatcher.
METHODS
Mojolicious::Plugin::Mobi inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
$plugin->register;
Register plugin in Mojolicious application.