Documentation · ViewHelper reference

XSD schema file | vhs master

Condition / Form / HasValidatorViewHelper

Form: Field Has Validator?

Takes a property (dotted path supported) and renders the then-child if the property at the given path has any /

  • Tag usage example

    <v:condition.form.hasValidator then="[mixed]" else="[mixed]" condition="1" property="NULL" validatorName="NULL" object="[anySimpleType]">
    	<!-- tag content - may be ignored! -->
    </v:condition.form.hasValidator>
  • Inline usage example

    {v:condition.form.hasValidator(then: [mixed], else: [mixed], condition: 1, property: 'NULL', validatorName: 'NULL', object: [anySimpleType])}

Arguments

Argument Description Type
condition

Condition expression conforming to Fluid boolean rules

boolean
else

Value to be returned if the condition if not met.

mixed
object

Optional object - if not specified, grabs the associated form object.

anySimpleType
property

The property name, dotted path supported, to determine required.

string
then

Value to be returned if the condition if met.

mixed
validatorName

The class name of the Validator that indicates the property is required.

string
Required attribute

Revision history

commit da7677bc74f14e9a9300e4ba4487e52c3cb97642
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Apr 20 01:13:33 2014 +0200

    [TASK] Switch to namespaces

commit 8bb2fc5ee124ba19b0a0ab8e061c9a153fc4651f
Author: Xaver Maierhofer <*****@xwissen.info>
Date:   Sun Jan 18 17:56:13 2015 +0100

    [TASK] Reference Copyright to license.md file

commit b7af0a196741b10d70d88403160597960969f5af
Author: Claus Due <*****@namelesscoder.net>
Date:   Sun Jan 25 19:42:22 2015 +0100

    [BUGFIX] Incorrect object class if HasValidator receives object
    
    When resolving the form object from the ViewHelperVariableContainer, the class name was correctly extracted. When passing the DomainObject as ViewHelper argument, the class would not be resolved, causing an error to display.