Created
March 6, 2012 07:41
-
-
Save sshaw/1984738 to your computer and use it in GitHub Desktop.
CGI::Expand in Mojolicious::Controller
This file contains hidden or 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
| use Mojo::Base 'Mojolicious'; | |
| use CGI::Expand; | |
| sub startup | |
| { | |
| my $self = shift; | |
| $self->hook(before_dispatch => sub { | |
| my $c = shift; | |
| my $hash = CGI::Expand->expand_hash($c->req->params->to_hash); | |
| $c->param($_ => $hash->{$_}) for keys %$hash; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment