-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
83 lines (60 loc) · 2.6 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Dancer::Plugin::MobileDevice README
SYNOPSIS
package MyWebApp;
use Dancer;
use Dancer::Plugin::MobileDevice;
get '/' => sub {
if (is_mobile_device) {
# do something for mobile
}
else {
# do something for regular agents
}
};
DESCRIPTION
A plugin for Dancer-powered webapps to easily detect mobile clients and
offer a simplified layout, and/or act in different ways.
The plugin offers a `is_mobile_device' keyword, which returns true if
the device is recognised as a mobile device.
It can also automatically change the layout used to render views for
mobile clients.
Custom layout for mobile devices
This plugin can use a custom layout for recognised mobile devices,
allowing you to present a simplified page template for mobile devices.
To enable this, use the `mobile_layout' setting for this plugin - for
instance, add the following to your config file:
plugins:
mobiledevice:
mobile_layout: 'mobile'
This means that, when `template' is called to render a view, if the
client is recognised as a mobile device, the layout named `mobile' will
be used, rather than whatever the current `layout' setting is.
You can of course still override this layout by supplying a layout
option to the `template' call in the usual way (see the Dancer
documentation for how to do this).
AUTHOR
Alexis Sukrieh, `<sukria at sukria.net>'
BUGS
Please report any bugs or feature requests to
http://github.com/sukria/Dancer-Plugin-MobileDevice/issues
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Dancer::Plugin::MobileDevice
You can also look for information at:
* RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dancer-Plugin-MobileDevice
* AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Dancer-Plugin-MobileDevice
* CPAN Ratings
http://cpanratings.perl.org/d/Dancer-Plugin-MobileDevice
* Search CPAN
http://search.cpan.org/dist/Dancer-Plugin-MobileDevice/
ACKNOWLEDGEMENTS
This plugin was initially written for an article of the Dancer advent
calendar 2010.
LICENSE AND COPYRIGHT
Copyright 2010 Alexis Sukrieh.
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.