| Perldoc-Server documentation | Contained in the Perldoc-Server distribution. |
Perldoc::Server::Controller::Source - Catalyst Controller
Catalyst Controller.
Jon Allen
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| Perldoc-Server documentation | Contained in the Perldoc-Server distribution. |
package Perldoc::Server::Controller::Source; use strict; use warnings; use 5.010; use parent 'Catalyst::Controller';
sub index :Path { my ( $self, $c, @pod ) = @_; my $title = join '::',@pod; $c->stash->{title} = $title; $c->stash->{path} = \@pod; $c->stash->{pod} = $c->model('Pod')->pod($title); $c->stash->{filename} = $c->model('Pod')->find($title); $c->stash->{source_view} = 1; given ($title) { when (/^([A-Z])/) { $c->stash->{breadcrumbs} = [ { url => $c->uri_for('/index/modules'), name => 'Modules' }, { url => $c->uri_for('/index/modules',$1), name => $1 }, ]; } default { $c->stash->{breadcrumbs} = [ { url => $c->uri_for('/index/pragmas'), name => 'Pragmas' }, ]; } } $c->forward('View::Pod2Source'); }
1;