Perldoc::Server::Controller::Root - Root Controller for Perldoc::Server


Perldoc-Server documentation Contained in the Perldoc-Server distribution.

Index


Code Index:

NAME

Top

Perldoc::Server::Controller::Root - Root Controller for Perldoc::Server

DESCRIPTION

Top

[enter your description here]

METHODS

Top

index

end

Attempt to render a view, if needed.

AUTHOR

Top

Jon Allen

LICENSE

Top

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::Root;

use strict;
use warnings;
use parent 'Catalyst::Controller';

#
# Sets the actions in this controller to be registered with no prefix
# so they function identically to actions created in MyApp.pm
#
__PACKAGE__->config->{namespace} = '';

sub index :Path :Args(0) {
    my ( $self, $c ) = @_;

    $c->stash->{title}         = 'Perldoc::Server';
    $c->stash->{page_name}     = 'About this site';
    $c->stash->{page_template} = 'homepage.tt';
    $c->stash->{search_path}   = [grep {/\w/} @{$c->config->{search_path}}];
}

sub default :Path {
    my ( $self, $c ) = @_;
    $c->response->body( 'Page not found' );
    $c->response->status(404);
}

sub end : ActionClass('RenderView') {}

1;