Jason,

Nice work!  I've swapped out my own hackish messaging system for your
module and it seems to be working great!  

One problem I encountered is that template parameters beginning with
underscores are invisible to Template Toolkit templates.  So 
'__CAP_Messages' doesn't work with TT :(

So I add the messages to my template manually.  No big deal.  However, 
I do find myself duplicating some of the stuff you already have in
_filter_template():  namely converting '-message' to 'message'.  Maybe
you could make the 'for_template' option also available via the
messages() method?

Finally, it would be nice to be able to attach arbitrary metadata to a
message.  For instance, I do something like this to create a message
containing a list of the missing form fields:

     my @missing = $self->dfv_results->missing;
     if (@missing) {
         $self->add_error_message(
             'message' => 'missing_fields',
             'fields'  => [EMAIL PROTECTED],
         );
     }

Maybe in CAP::MessageStack this could be done with something like this?

     $self->add_error_message(
         '-message' => 'missing_fields',
         '-meta'    => {
              'missing_fields' => [EMAIL PROTECTED],
         },
     );



Michael

---
Michael Graham <[EMAIL PROTECTED]>



---------------------------------------------------------------------
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]

Reply via email to