| Jifty documentation | Contained in the Jifty distribution. |
Jifty::Plugin::SkeletonApp::Dispatcher - Dispatcher for SkeletonApp plugin
Elementary things for a basic app.
Add 'Home' item to the top navigation unless it's there already.
Sets language of the current session if the request has '_jifty_lang' argument.
| Jifty documentation | Contained in the Jifty distribution. |
use warnings; use strict; package Jifty::Plugin::SkeletonApp::Dispatcher;
use Jifty::Dispatcher -base;
on '**' => run { my $top = Jifty->web->navigation; # Do not override the 'Home' menu item if the app had set it already unless ( $top->child('Home') ) { $top->child( Home => url => "/", sort_order => 1, label => _('Home') ); } return (); };
before '**' => run { if (my $lang = Jifty->web->request->arguments->{_jifty_lang}) { Jifty->web->session->set(jifty_lang => $lang); } }; 1;