1 package CatalystX::HelpText::Model;
3 use MooseX::Types::Moose qw/Str Undef/;
4 use MooseX::Types::Path::Class qw/ Dir /;
6 use Carp qw/ croak confess/;
7 use namespace::autoclean;
9 extends 'Catalyst::Model';
11 has help_files_path => (
21 has help_files_ext => (
27 has wrapper_css_class => (
30 default => 'help_text',
40 sub get_help_text_for {
41 my ($self, $help_key) = @_;
42 confess('No $help_key provided') unless $help_key;
45 $fn .= "." . $self->help_files_ext if defined($self->help_files_ext);
47 my $file = $self->_get_file($fn);
50 return sprintf('<%s class="%s">%s</%s>',
52 $self->wrapper_css_class,
58 croak "Cannot find help text '$help_key' in $file";