Fork me on GitHub
Edit on GitHub << back to Validation

visitor validator

Description

The VisitorFieldValidator allows you to forward validation to object properties of your action using the object’s own validation files. This allows you to use the ModelDriven development pattern and manage your validations for your models in one place, where they belong, next to your model classes. The VisitorFieldValidator can handle either simple Object properties, Collections of Objects, or Arrays.

Parameters

Examples

<validators>
    <!-- Plain Validator Syntax -->
    <validator type="visitor">
        <param name="fieldName">user</param>
        <param name="context">myContext</param>
        <param name="appendPrefix">true</param>
    </validator>
 
    <!-- Field Validator Syntax -->
    <field name="user">
       <field-validator type="visitor">
          <param name="context">myContext</param>
          <param name="appendPrefix">true</param>
       </field-validator>
    </field>
</validators>