Typically in the past i did the following for reporting errors..
## display runmode
sub editItem() {
my ($self,$status) = @_;
my $tmp = $self->load_tmpl('editFeatures');
# set appropriate success/fail messages
$tmp->param('success_msg' => $status->{'success_msg'}, 'success' =>
1) if ($status->{'success_msg'} ne '');
$tmp->param('failure_msg' => $status->{'failure_msg'}, 'failure' =>
1) if ($status->{'failure_msg'} ne '');
return $tmp->output;
}
And then let had this in my template
<TMPL_IF NAME="success">
<span class="success_msg"><TMPL_VAR NAME="success_msg"></span><br />
</TMPL_IF>
<TMPL_IF NAME="failure">
<span class="failure_msg"><TMPL_VAR NAME="failure_msg"></span><br />
</TMPL_IF>
Simple, however I guess the advantage with your way of doing things is
that the error message becomes a part of the template file insted of
inside the code, making life much easier for the HTML guys, insted of
them asking me to change an error message eh ?
Thanks again !! I'm psyched now, learning lots of cool stuff. Can't
wait to play with an authentication method that isn't as hacked up as
mine, passing user id and sessionpassword with every post ;)
Jeff.
On Mon, 21 Mar 2005 13:56:55 -0500, Jason Purdy <[EMAIL PROTECTED]> wrote:
> D'oh! Forgot that part!
>
> Also, you may need to put whatever flag in that anonymous hashref
> ('some_errors' in the docs) that triggers your template code that
> something is off.
>
> - Jason
>
> Michael Peters wrote:
> > Jason Purdy wrote:
> >
>
> >> if (!$bookid) {
> >> return $self->bookPool( { 'db_error' => 1, 'some_errors' => 1 } );
>
--
Jeff MacDonald
http://www.halifaxbudolife.ca
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]