On 11/3/06, Ian Docherty <[EMAIL PROTECTED]> wrote:
Yes this pretty much agrees with my interpretation. It is not so much the location of the constraint rules as how to propagate them to the view (i.e the stash)
Do you mean for the purposes of client-side validation? Or do you just mean how to display the (server-generated) error messages in the view? If you mean the latter, the way I do it is to pass in a form object as a single parameter (usually named "form"). The form object itself has a list of (possibly localized) error messages, as does each field object contained in the form object. All of these messages are generated (by a $form->validate() call) before the form object is passed to the template. In the template, there's a place for form-wide errors to appear (if any) plus a place near each field for field-specific errors to appear. IMO, all required data should already exist before anything is passed to a template. The template should just decide where things should go, possibly with minor massaging for visual purposes. -John _______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
