Dancer2...utoPage(3)
π Dancer2::Handler::AutoPage π
okay bestie, so this is a page from the User Contributed Perl Documentation section (you know, the good stuff), and it's literally all about Dancer2::Handler::AutoPage β the class that handles the whole AutoPage situation. it's giving "automatic pages, no route-writing required" energy and honestly? obsessed. π¦
β¨ VERSION β¨
this is version 2.2.1, periodt. π
πΈ DESCRIPTION πΈ
so AutoPage is a Handler β and heads up, it's turned off by default π β and its whole job is serving up pages that match a template that already exists. like, if a view exists whose name matches the requested path, Dancer2 will process that request using the Autopage handler. no cap.
to turn it on, add this to your config file:
auto_page: 1
and that's it!! this lets you serve simple pages sooooo easily, without having to write a route definition for every single one of them. the way that saves you so much boilerplate ππ
but lowkey important: if there's no view with the requested name, the route passes β which lets other matching routes get dispatched. so it's not a black hole, it just politely steps aside. π«Ά
π METHODS π
π« register
creates the routes. simple as that.
π« code
a code reference that processes the route request. it does the doing. β¨
π« methods
the methods that should be served for autopages.
Default: head, get.
π« regexp
the regexp (path) we want to match.
Default: /:page.
π AUTHOR π
Dancer Core Developers β iconic behavior, fr fr.
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2026 by Alexis Sukrieh.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, and legally speaking, free as a butterfly. π¦
and that's the whole page bestie, we ate and left no crumbs π β¨
later babes β this was Dancer2::Handler::AutoPage under perl v5.42.3, dated 2026-09-20. mwah ππ
π¦ where this page comes from
- fedora 44: perl-Dancer2 2.2.1-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms