1 package TreeOfTexts::Controller::Root;
3 use namespace::autoclean;
4 use TreeOfTexts::Model::Analysis qw/ run_analysis /;
6 BEGIN { extends 'Catalyst::Controller' }
9 # Sets the actions in this controller to be registered with no prefix
10 # so they function identically to actions created in MyApp.pm
12 __PACKAGE__->config(namespace => '');
16 TreeOfTexts::Controller::Root - Root Controller for TreeOfTexts
20 [enter your description here]
30 sub index :Path :Args(0) {
31 my ( $self, $c ) = @_;
33 my $m = $c->model('Analysis');
34 $c->stash->{svg} = $m->{'svg'};
35 $c->stash->{variants} = $m->{'variants'};
36 $c->stash->{text_title} = $m->{'title'};
37 $c->stash->{total} = $m->{'variant_count'};
38 $c->stash->{genealogical} = $m->{'genealogical_count'};
39 $c->stash->{conflict} = $m->{'conflict_count'};
40 $c->stash->{template} = 'index.tt';
45 Standard 404 error page
50 my ( $self, $c ) = @_;
51 $c->response->body( 'Page not found' );
52 $c->response->status(404);
57 Attempt to render a view, if needed.
61 sub end : ActionClass('RenderView') {}
69 This library is free software. You can redistribute it and/or modify
70 it under the same terms as Perl itself.
74 __PACKAGE__->meta->make_immutable;