Mojolicious-Plugin-ContextResources

 view release on metacpan or  search on metacpan

lib/Mojolicious/Plugin/ContextResources.pm  view on Meta::CPAN


our $VERSION = '0.02';

# Get current context path
sub _context($) {
    my ($c) = @_;

    my @path;
    my $stash = $c->stash;
    if( $stash->{'controller'} && $stash->{'action'} ) {
        push @path, split m{[/\-]}, $stash->{'controller'};
        push @path, $stash->{'action'};
    } elsif( $stash->{'mojo.captures'}{'template'} ) {
        push @path, $stash->{'mojo.captures'}{'template'};
    }
    return @path;
}

sub register {
    my ($self, $app, $conf) = @_;



( run in 0.699 second using v1.01-cache-2.11-cpan-71847e10f99 )