apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: Structures_Form_Rule_Required

Source Location: /Structures_Form-0.8.0devel/Form/Rule/Required.php

Class Overview

Structures_Form_Rule_Base
   |
   --Structures_Form_Rule_Required



Variables

Methods


Inherited Variables

Inherited Methods

Class: Structures_Form_Rule_Base

Structures_Form_Rule_Base::__construct()
Constructor.
Structures_Form_Rule_Base::addSubstitution()
Adds a new subsitution to the substitution array.
Structures_Form_Rule_Base::generateErrorString()
Generates an error string based on the class' error string and the class' substitution array.
Structures_Form_Rule_Base::removeSubstitution()
Removes a subsitution from the substitution array.
Structures_Form_Rule_Base::setErrorMessage()
Sets the error message to be used when a value fails to validate.
Structures_Form_Rule_Base::setSubstitutions()
Sets the array of error message substitutions.

Class Details

[line 19]


[ Top ]


Class Variables

$errorMessage =  '{elementName} is required.'

[line 30]

The error message to be returned if the element does not validate.

The values in {curly braces} will be substituted for values from the substitiution array.

  • Access: protected

Type:   string
Overrides:   Array


[ Top ]



Method Detail

__construct (Constructor)   [line 43]

void __construct( [string $errorMessage = null], [array $substitutions = null])

Constructor. Just calls the parent constructor.

This rule does not require any additional arguments, but may accept two optional arguments.

  • Access: public

Overrides Structures_Form_Rule_Base::__construct() (Constructor.)

Parameters:

string   $errorMessage   —  Optional error message.
array   $substitutions   —  Optional substitution array.

[ Top ]

validate   [line 56]

mixed validate( Structures_Form_ElementInterface $element)

Validates the given element.
  • Return: true if the value is ok, an error message otherwise.
  • Access: public

Parameters:

object   $element   —  A Structures_Form element.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:44:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.