| Perldoc-Server documentation | Contained in the Perldoc-Server distribution. |
Perldoc::Server::Controller::Functions - 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::Functions; use strict; use warnings; use parent 'Catalyst::Controller';
sub index :Path :Args(0) { my ( $self, $c ) = @_; $c->response->redirect( $c->uri_for('/index/functions') ); } sub view :Path :Args(1) { my ($self, $c, $function) = @_; # Count the page views in the user's session my $uri = "/functions/$function"; $c->session->{counter}{$uri}{count}++; $c->session->{counter}{$uri}{name} = $function; $c->stash->{title} = $function; $c->stash->{pod} = $c->model('PerlFunc')->pod($function); $c->stash->{breadcrumbs} = [ {url=>$c->uri_for('/index/functions'), name=>'Functions'} ]; $c->stash->{page_template} = 'function.tt'; $c->stash->{contentpage} = 1; $c->forward('View::Pod2HTML'); }
1;