[Catalyst] Can't get view / template to work ?
Tomas Doran
bobtfish at bobtfish.net
Tue Oct 30 23:00:06 GMT 2012
On 30 Oct 2012, at 16:52, Craig Chant wrote:
> I seem stuck with implementing my first view / template.
>
> I have a controller Login.pm
>
> I ran the view helper script ‘create view HTML HTML::template’
>
This can't possibly have worked? You mean create view HTML HTML::Template right?
> As per the tutorial I’ve added the following to the config section of MyApp.pm
>
> TEMPLATE_EXTENSION => '.tp',
This needs to be inside the following block
> 'View::HTML' => {
> #Set the location for templates files
> INCLUDE_PATH => [
> __PACKAGE__->path_to( 'root', 'src' ),
> ],
> },
>
> I have created a template in ‘root/src/login’ of login.tp
>
> In my controller I have …
>
> sub login :Path :Args(0) {
> my ( $self, $c) = @_;
>
> $c->stash(template => 'login.tp');
>
> }
>
> But all I get is…
>
No idea.
>
> What am I doing wrong?
>
Not showing us the full debug output of starting the server and making the request.
Sorry to be harsh - but it's impossible to divine what code your app is running without that output…
Cheers
t0m
More information about the Catalyst
mailing list