-
-
Save anonymous/497099b60d24c92e5960 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub _routes { | |
my ( $self ) = @_; | |
my $r = $self->routes; | |
# when meta- and languagedata are given, set default route | |
if ( %{ $self->app->_metadata } && %{ $self->app->_language } ) { | |
$r->route( '/' )->to( controller => 'catalog', action => 'index', category => '', subcategory => '' ); | |
$r->route( '/catalog' )->to( controller => 'catalog', action => 'index', category => '', subcategory => '' ); | |
$r->route( '/catalog/index' ) | |
->to( controller => 'catalog', action => 'index', category => '', subcategory => '' ); | |
$r->any('/*whatever' => sub { $_[0]->redirect_to("/") }); | |
} | |
else { | |
$r->route( '*' )->to( | |
'controller' => 'catalog', | |
'action' => 'error_no_metadata', | |
); | |
} | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment