Skip to content

Instantly share code, notes, and snippets.

@nicomen
Created March 10, 2014 12:44
Show Gist options
  • Save nicomen/9464351 to your computer and use it in GitHub Desktop.
Save nicomen/9464351 to your computer and use it in GitHub Desktop.
$routes->get('/:category/:year/:month/:day/:seo_title' => [ year => qr/\d{4}/, month => qr/\d{2}/, day => qr/\d{2}/ ] )
->to( cb => sub {
my ($self) = shift;
my $id = _lookup_id_by_title($self->stash->{seo_title});
$self->redirect_to('article', { id => $id });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment