Mojolicious::Plugin::Breadcrumbs - Mojolicious plugin for autogenerating breadcrumbs links
#!perl use Mojolicious::Lite; plugin 'Breadcrumbs'; get '/user/account-settings' => 'account-settings'; app->start; __DATA__ @@ account-settings.html.ep You are at <%== breadcrumbs %>
The output in the browser then be this (actual output will not have line breaks):
You are at <section class="breadcrumbs"> <a href="/">Home</a><span class="breadcrumb_sep">▸</span> <a href="/user">User</a><span class="breadcrumb_sep">▸</span> <span class="last_breadcrumb">Account settings</span> </section>
By default, / path will be named Home, and all other paths will be named by changing - and _ characters to spaces and capitalizing the first letter. You can provide your own mapping for certain paths, by passing a mapping hashref to breadcrumbs helper. Anything not found in the map will still be named as described above.
/
Home
-
_
breadcrumbs
#!perl use Mojolicious::Lite; plugin 'Breadcrumbs'; app->breadcrumbs({ '/' => 'Start page', '/user' => 'Your account', '/user/account-settings' => 'Settings', }); get '/user/account-settings' => 'account-settings'; app->start; __DATA__ @@ account-settings.html.ep You are at <%== breadcrumbs %>
You are at <section class="breadcrumbs"> <a href="/">Start page</a><span class="breadcrumb_sep">▸</span> <a href="/user">Your account</a> <span class="breadcrumb_sep">▸</span> <span class="last_breadcrumb">Settings</span> </section>
Mojolicious::Plugin::Breadcrumbs is a Mojolicious plugin for auto-generating breadcrumbs.
Mojolicious::Plugin::Breadcrumbs inherits all methods from Mojolicious::Plugin and implements the following new ones.
->register()
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
Using in HTML:
You are at <%== breadcrumbs %>
Setting custom link names:
app->breadcrumbs( '/' => 'Start page', '/user' => 'Your account', '/user/account-settings' => 'Settings', );
See SYNOPSIS for full description of use and arguments.
Fork this module on GitHub: https://github.com/zoffixznet/Mojolicious-Plugin-Breadcrumbs
To report bugs or request features, please use https://github.com/zoffixznet/Mojolicious-Plugin-Breadcrumbs/issues
If you can't access GitHub, you can email your request to bug-mojolicious-plugin-breadcrumbs at rt.cpan.org
bug-mojolicious-plugin-breadcrumbs at rt.cpan.org
You can use and distribute this module under the same terms as Perl itself. See the LICENSE file included in this distribution for complete details.
LICENSE
To install Mojolicious::Plugin::Breadcrumbs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Breadcrumbs
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Breadcrumbs
For more information on module installation, please visit the detailed CPAN module installation guide.