Created
January 14, 2013 01:44
-
-
Save MadMartigan/4527228 to your computer and use it in GitHub Desktop.
how to set layout in before_dispatch hook
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
$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