root/tags/0.11.1RC3/samples/app/config/global_filters.xml

Revision 2202, 1.7 KB (checked in by david, 12 months ago)

use FPF for error message insertion in sample app

  • Property svn:keywords set to Id
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<configurations xmlns="http://agavi.org/agavi/1.0/config">
3 
4  <configuration context="web">
5    <filters>
6     
7      <filter name="FormPopulationFilter" class="AgaviFormPopulationFilter">
8        <parameter name="methods">
9          <parameter>write</parameter>
10        </parameter>
11        <parameter name="output_types">
12          <parameter>html</parameter>
13          <parameter>xhtml</parameter>
14        </parameter>
15        <!-- for all field error messages. errors that yield no match and those that have no corresponding field are inserted using rules defined in "error_messages". errors that belong to more than one field (e.g. date validator) can be handled using "multi_field_error_messages" -->
16        <parameter name="field_error_messages">
17          <!-- ${htmlnsPrefix} is either empty (for HTML) or something like "html:" for XHTML documents with xmlns="..." notation. Always use this, makes your code more bullet proof. XPath needs the namespaces when the document is namespaced -->
18          <parameter name="parent::${htmlnsPrefix}dd">
19            <!-- can be any of "before", "after" or "child" (to insert as prev, next sibling or last child) -->
20            <parameter name="location">after</parameter>
21            <!-- a container groups all errors for one element -->
22            <parameter name="container"><![CDATA[<dd>${errorMessages}</dd>]]></parameter>
23            <parameter name="markup"><![CDATA[<p class="error">${errorMessage}</p>]]></parameter>
24          </parameter>
25          <!-- you could have more rules above, e.g. ${htmlnsPrefix}input[@type="checkbox"]... to have a rule that only applies to checkbox elements. first match is used. -->
26        </parameter>
27      </filter>
28     
29    </filters>
30  </configuration>
31 
32</configurations>
Note: See TracBrowser for help on using the browser.