SilverStripe 2.4 API Docs
  • Package
  • Class
  • Tree
  • Deprecated
Version: master
  • master
  • 3.1
  • 3.0
  • 2.4
  • tagfield

Packages

  • cms
    • assets
    • batchaction
    • batchactions
    • bulkloading
    • comments
    • content
    • core
    • export
    • publishers
    • reports
    • security
    • tasks
  • forms
    • actions
    • core
    • fields-basic
    • fields-dataless
    • fields-datetime
    • fields-files
    • fields-formatted
    • fields-formattedinput
    • fields-relational
    • fields-structural
    • transformations
    • validators
  • installer
  • None
  • PHP
  • sapphire
    • api
    • bulkloading
    • control
    • core
    • cron
    • dev
    • email
    • fields-formattedinput
    • filesystem
    • formatters
    • forms
    • i18n
    • integration
    • misc
    • model
    • parsers
    • search
    • security
    • tasks
    • testing
    • tools
    • validation
    • view
    • widgets

Classes

  • CustomRequiredFields
  • RequiredFields
  • Validator

Class RequiredFields

Required Fields allows you to set which fields need to be present before submitting the form Submit an array of arguments or each field as a seperate argument. Validation is performed on a name by name basis.

Object
Extended by Validator
Extended by RequiredFields

Direct known subclasses

CustomRequiredFields, Member_Validator

Package: forms\validators
Located at sapphire/forms/RequiredFields.php

Methods summary

public
# __construct( )

Pass each field to be validated as a seperate argument to the constructor of this object. (an array of elements are ok)

Pass each field to be validated as a seperate argument to the constructor of this object. (an array of elements are ok)

Overrides

Object::__construct
public
# useLabels( mixed $flag )
public
# removeValidation( )

Clears all the validation from this object.

Clears all the validation from this object.

public
# debug( )

Debug helper

Debug helper

public
# javascript( )
public
# php( mixed $data )

Allows validation of fields via specification of a php function for validation which is executed after the form is submitted

Allows validation of fields via specification of a php function for validation which is executed after the form is submitted

public
# addRequiredField( mixed $field )

Add's a single required field to requiredfields stack

Add's a single required field to requiredfields stack

public
# removeRequiredField( mixed $field )
public
# appendRequiredFields( mixed $requiredFields )

allows you too add more required fields to this object after construction.

allows you too add more required fields to this object after construction.

public
# fieldIsRequired( mixed $fieldName )

Returns true if the named field is "required". Used by FormField to return a value for FormField::Required(), to do things like show *s on the form template.

Returns true if the named field is "required". Used by FormField to return a value for FormField::Required(), to do things like show *s on the form template.

Overrides

Validator::fieldIsRequired
public
# getRequired( )

getter function for append

getter function for append

Methods inherited from Validator

getCombinedError(), getError(), getErrors(), getJavascriptValidationHandler(), get_javascript_validator_handler(), includeJavascriptValidation(), requireField(), setForm(), setJavascriptValidationHandler(), set_javascript_validation_handler(), showError(), validate(), validationError()

Methods inherited from Object

__call(), __toString(), addMethodsFrom(), addStaticVars(), addWrapperMethod(), add_extension(), add_static_var(), allMethodNames(), cacheToFile(), cacheToFileWithArgs(), clearCache(), combined_static(), create(), createMethod(), create_from_string(), defineMethods(), exists(), extInstance(), extend(), getCustomClass(), getExtensionInstance(), getExtensionInstances(), get_extensions(), get_static(), hasExtension(), hasMethod(), has_extension(), invokeWithExtensions(), is_a(), loadCache(), parentClass(), parse_class_spec(), remove_extension(), sanitiseCachename(), saveCache(), set_stat(), set_static(), set_uninherited(), stat(), strong_create(), uninherited(), uninherited_static(), useCustomClass()

Magic methods summary

Properties summary

protected mixed $required
#
protected boolean $useLabels
#

Properties inherited from Validator

$errors, $form, $javascriptValidationHandler, $javascript_validation_handler

Properties inherited from Object

$class, $extension_instances, $extensions

Comments

Comment policy: Please use comments for tips and corrections about the described functionality. Comments are moderated, we reserve the right to remove comments that are inappropriate or are no longer relevant.
Use the Silverstripe Forum to ask questions.
blog comments powered by Disqus
SilverStripe 2.4 API Docs API documentation generated by ApiGen 2.8.0