Dancer2-Plugin-MobileDevice

 view release on metacpan or  search on metacpan

lib/Dancer2/Plugin/MobileDevice.pm  view on Meta::CPAN

to present a simplified page template for mobile devices.  To enable this, use
the C<mobile_layout> setting for this plugin - for instance, add the following
to your config file:

  plugins:
    MobileDevice:
      mobile_layout: 'mobile'

This means that, when C<template> is called to render a view, if the client is
recognised as a mobile device, the layout named C<mobile> will be used, rather
than whatever the current C<layout> setting is.

You can of course still override this layout by supplying a layout option to the
C<template> call in the usual way (see the L<Dancer2> documentation for how to do
this).

B<Caution>: Do not change C<mobile_layout> during the processing of
a request.  That is unsupported and the behaviour of the plugin is not
guaranteed in that situation.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Dancer2::Plugin::MobileDevice

You can also look for information at:

=over

=item *

L<MetaCPAN|https://metacpan.org/pod/Dancer2::Plugin::MobileDevice>.

=item *

L<GitHub|https://github.com/cxw42/Dancer2-Plugin-MobileDevice>

=back

=head1 BUGS

Please report any bugs or feature requests to
L<http://github.com/cxw42/Dancer2-Plugin-MobileDevice/issues>

=head1 FUNCTIONS

This section exists to satisfy L<Pod::Coverage> :D .

=head2 is_mobile_device

Return truthy if the current request is from a mobile device.

=head2 BUILD

Adds the hooks described above.

=head1 ACKNOWLEDGEMENTS

This plugin is a Dancer2 port of L<Dancer::Plugin::MobileDevice>,
initially written for an article of the Dancer advent calendar 2010.

Thanks to the Dancer core developers for contributions.  Please see the
package metadata for additional contributors.

=head1 LICENSE

Copyright (C) 2019 Christopher White E<lt>cxw@cpan.orgE<gt>

Portions copyright (c) 2017 Yanick Champoux

Portions copyright (c) 2010 Alexis Sukriah

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=head1 AUTHOR

Christopher White E<lt>cxw@cpan.orgE<gt>

=cut



( run in 0.946 second using v1.01-cache-2.11-cpan-39bf76dae61 )