Date: | Wed, 2 Nov 2005 00:58:41 +0200 |
From: | Maxim Vorobjov <maxim.vorobjov [...] gmail.com> |
To: | bug-template-timer [...] rt.cpan.org |
Subject: | Using Template Timer from Catalyst with VIEW element generates error |
Hi, I think that Template::Timer is really nice tool, it can help me profile
my site. But..
When I use Template::Timer from Catalyst with VIEW element it generates
error:
Couldn't render template "undef error - Can't call method "name" on
unblessed reference at /usr/lib/perl5/site_perl/5.8.0/Template/Timer.pm line
66. "
WIthout Template::Timer everything is ok. Can you help me with this case,
please?
#Example template:
#xmlview.tt
[% VIEW myview notfound = 'notfound' %]
[% BLOCK file %]
- [% item.name <http://item.name> %]
[% END %]
[% BLOCK directory %]
* [% item.name <http://item.name> %]
[% item.content(myview) FILTER indent %]
[% END %]
[% BLOCK notfound %]
NOT FOUND
[% END %]
[% END %]
[% USE dir = Directory('/') %]
[% myview.print(dir) %]
#And Controller:
#xmlview.pm
package MasonTest::C::xmlview;
use strict;
use base 'Catalyst::Base';
=head1 NAME
MasonTest::C::xmlview - Catalyst component
=head1 SYNOPSIS
See L<MasonTest>
=head1 DESCRIPTION
Catalyst component.
=head1 METHODS
=over 4
=item default
=cut
sub default : Private {
my ( $self, $c ) = @_;
$c->stash->{template} = 'xmlview.tt <http://xmlview.tt>';
}
=back
=head1 AUTHOR
A clever guy
=head1 LICENSE
This library is free software . You can redistribute it and/or modify
it under the same terms as perl itself.
=cut
1;
--
Best Regards,
Vorobjov Maxim