Skip to content

Instantly share code, notes, and snippets.

@MadMartigan
Created January 14, 2013 01:44
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 MadMartigan/4527228 to your computer and use it in GitHub Desktop.
Save MadMartigan/4527228 to your computer and use it in GitHub Desktop.
how to set layout in before_dispatch hook
$self->hook(
before_dispatch => sub {
my $c = shift;
if (!$c->param('layout')) {
if ($c->req->is_xhr) {
$c->stash(layout => 'ajax');
}
}
.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment