Dancer::Plugin::Device::Layout - Dancer v1 plugin Dancer::Plugin::Device::Layout dynamically changes layout to match user agent's best layout.
This documentation describes Dancer::Plugin::Device::Layout v0.1.
package MyApp; use Dancer ':syntax'; use Dancer::Plugin::Device::Layout; get '/' => sub { my $tokens = {}; my $options = { device_layout }; template 'index', $tokens, $options; };
Dancer::Plugin::Device::Layout was invented to extend YANICK's Dancer::Plugin::MobileDevice with tablet detection.
Returns context sensetive layout information.
# Returns ( layout => 'normal' ) my $options = { device_layout }; # Returns 'normal' my $display_layout = device_layout;
"device_layout" does have diagnostic functionality. It takes a hash to override some internal values.
Ignores the user agent and assume user agent is as provided.
Dancer::Plugin::Device::Layout uses Dancer's config system to configure itself.
Extend your config.yml like this:
config.yml
plugins: Device::Layout: normal_layout: normal mobile_layout: mobile tablet_layout: tablet no_tablet: 0 tablet_as_mobile: 0 no_mobile: 0
The normal layout when user agent is nighter a tablet nor a mobile device. Default is 'main'.
The mobile layout when user agent is a mobile but not a tablet device. Default is 'mobile'.
The tablet layout when user agent is a tablet device. Default is 'tablet'.
Disable tablet detection. Default is '0'.
Treat tablet as mobile devices. Default is undef.
undef
Disable mobile detection. Default is '0'.
Currently there are no incompatibilities known.
Currently there are no bugs or limitations known. Please report bugs at GitHub Issues.
BURNERSK burnersk@cpan.org
Dancer::Plugin::Device::Layout by BURNERSK is licensed under a Artistic License 2.0 License.
Copyright © 2013, BURNERSK. Some rights reserved.
To install Dancer::Plugin::Device::Layout, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Plugin::Device::Layout
CPAN shell
perl -MCPAN -e shell install Dancer::Plugin::Device::Layout
For more information on module installation, please visit the detailed CPAN module installation guide.