On Mar 14, 2007, at 12:51 AM, David Christensen wrote:
I'm now on tutorial 2 of 9, and have run the various scripts,
entered modules and
templates, etc., as directed for the books database example. When
I fire up the
development server and browse to:
http://p3800.holgerdanske.com:3000/books/list
The server says:
[error] Couldn't render template "undef error - status_msg is
undefined
It looks like you've turned on debugging in Template, either
DEBUG_UNDEF or DEBUG_ALL (which gets you all the debugging options,
including UNDEF.) DEBUG_UNDEF is helpful if you want to make sure
you don't have any undefined variable values in your templates, but
the way most people use templates is to just leave anything they
don't need filled in empty.
One option if you want to keep DEBUG_UNDEF enabled, but not have it
throw an error for things like status_msg and error_msg that might
reasonably be blank is to do something like this in your view...
my @dont_leave_blank = qw(
status_msg error_msg
);
sub template_vars {
my ( $self, $c ) = @_;
my %vars = $self->NEXT::template_vars( $c );
foreach my $x ( @dont_leave_blank ) {
if ( ! defined $vars{ $x } ) { $vars{ $x } = q{} }
}
return %vars;
}
--
Jason Kohles
[EMAIL PROTECTED]
http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/