Skip to content

Instantly share code, notes, and snippets.

Created January 29, 2013 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/00a0481779489d9a840c to your computer and use it in GitHub Desktop.
Save anonymous/00a0481779489d9a840c to your computer and use it in GitHub Desktop.
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->route( '*' )->to( 'controller' => 'catalog', 'action' => 'index_404', category => '', subcategory => '' );
# $r->route('*')->to( 'controller' => 'mister', 'action' => 'minute');
}
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