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

Class: HTML_QuickForm2_Element_Date

Source Location: /HTML_QuickForm2-2.1.0/HTML/QuickForm2/Element/Date.php

Class Overview

HTML_Common2
   |
   --HTML_QuickForm2_Node
      |
      --HTML_QuickForm2_Container
         |
         --HTML_QuickForm2_Container_Group
            |
            --HTML_QuickForm2_Element_Date

Class for a group of elements used to input dates (and times).


Author(s):

Version:

  • Release: 2.1.0

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTML_QuickForm2_Container_Group

HTML_QuickForm2_Container_Group::appendChild()
Appends an element to the container
HTML_QuickForm2_Container_Group::getChildValues()
HTML_QuickForm2_Container_Group::getName()
HTML_QuickForm2_Container_Group::getSeparator()
Returns string(s) to separate grouped elements
HTML_QuickForm2_Container_Group::getType()
HTML_QuickForm2_Container_Group::insertBefore()
Inserts an element in the container
HTML_QuickForm2_Container_Group::prependsName()
HTML_QuickForm2_Container_Group::removeChild()
Removes the element from this container
HTML_QuickForm2_Container_Group::renameChild()
Prepends group's name to contained element's name
HTML_QuickForm2_Container_Group::render()
Renders the group using the given renderer
HTML_QuickForm2_Container_Group::setName()
HTML_QuickForm2_Container_Group::setSeparator()
Sets string(s) to separate grouped elements
HTML_QuickForm2_Container_Group::setValue()
HTML_QuickForm2_Container_Group::__toString()

Class: HTML_QuickForm2_Container

HTML_QuickForm2_Container::addElement()
Appends an element to the container (possibly creating it first)
HTML_QuickForm2_Container::appendChild()
Appends an element to the container
HTML_QuickForm2_Container::arrayMerge()
Merges two arrays
HTML_QuickForm2_Container::count()
Returns the number of elements in the container
HTML_QuickForm2_Container::getChildValues()
Returns the array containing child elements' values
HTML_QuickForm2_Container::getElementById()
Returns an element if its id is found
HTML_QuickForm2_Container::getElements()
Returns an array of this container's elements
HTML_QuickForm2_Container::getElementsByName()
Returns an array of elements which name corresponds to element
HTML_QuickForm2_Container::getIterator()
Returns a recursive iterator for the container elements
HTML_QuickForm2_Container::getJavascriptTriggers()
HTML_QuickForm2_Container::getJavascriptValue()
Returns Javascript code for getting the element's value
HTML_QuickForm2_Container::getRawValue()
Returns the container's value without filters applied
HTML_QuickForm2_Container::getRecursiveIterator()
Returns a recursive iterator iterator for the container elements
HTML_QuickForm2_Container::getValue()
Returns the container's value, possibly with filters applied
HTML_QuickForm2_Container::insertBefore()
Inserts an element in the container
HTML_QuickForm2_Container::persistentFreeze()
HTML_QuickForm2_Container::prependsName()
Whether container prepends its name to names of contained elements
HTML_QuickForm2_Container::removeChild()
Removes the element from this container
HTML_QuickForm2_Container::render()
Renders the container using the given renderer
HTML_QuickForm2_Container::setName()
HTML_QuickForm2_Container::toggleFrozen()
HTML_QuickForm2_Container::updateValue()
Called when the element needs to update its value from form's data sources
HTML_QuickForm2_Container::validate()
Performs the server-side validation
HTML_QuickForm2_Container::__call()
Appends an element to the container, creating it first
HTML_QuickForm2_Container::__toString()

Class: HTML_QuickForm2_Node

HTML_QuickForm2_Node::__construct()
Class constructor
HTML_QuickForm2_Node::addFilter()
Adds a filter
HTML_QuickForm2_Node::addRecursiveFilter()
Adds a recursive filter
HTML_QuickForm2_Node::addRule()
Adds a validation rule
HTML_QuickForm2_Node::applyFilter()
Helper function for applying filter callback to a value
HTML_QuickForm2_Node::applyFilters()
Applies non-recursive filters on element value
HTML_QuickForm2_Node::createRule()
Creates a validation rule
HTML_QuickForm2_Node::generateId()
Generates an id for the element
HTML_QuickForm2_Node::getContainer()
Returns the element containing current
HTML_QuickForm2_Node::getData()
Returns the element options
HTML_QuickForm2_Node::getDataSources()
Returns the data sources for this element
HTML_QuickForm2_Node::getError()
Returns the error message for the element
HTML_QuickForm2_Node::getId()
Returns the element's id
HTML_QuickForm2_Node::getJavascriptTriggers()
Returns IDs of form fields that should trigger "live" Javascript validation
HTML_QuickForm2_Node::getJavascriptValue()
Returns Javascript code for getting the element's value
HTML_QuickForm2_Node::getLabel()
Returns the element's label(s)
HTML_QuickForm2_Node::getName()
Returns the element's name
HTML_QuickForm2_Node::getRawValue()
Returns the element's value without filters applied
HTML_QuickForm2_Node::getType()
Returns the element's type
HTML_QuickForm2_Node::getValue()
Returns the element's value, possibly with filters applied
HTML_QuickForm2_Node::isRequired()
Checks whether an element is required
HTML_QuickForm2_Node::onAttributeChange()
Intercepts setting 'name' and 'id' attributes
HTML_QuickForm2_Node::persistentFreeze()
Changes the element's persistent freeze behaviour
HTML_QuickForm2_Node::removeRule()
Removes a validation rule
HTML_QuickForm2_Node::render()
Renders the element using the given renderer
HTML_QuickForm2_Node::renderClientRules()
Adds element's client-side validation rules to a builder object
HTML_QuickForm2_Node::setContainer()
Adds the link to the element containing current
HTML_QuickForm2_Node::setError()
Sets the error message to the element
HTML_QuickForm2_Node::setId()
Sets the element's id
HTML_QuickForm2_Node::setLabel()
Sets the element's label(s)
HTML_QuickForm2_Node::setName()
Sets the element's name
HTML_QuickForm2_Node::setValue()
Sets the element's value
HTML_QuickForm2_Node::storeId()
Stores the explicitly given id to prevent duplicate id generation
HTML_QuickForm2_Node::toggleFrozen()
Changes the element's frozen status
HTML_QuickForm2_Node::updateValue()
Called when the element needs to update its value from form's data sources
HTML_QuickForm2_Node::validate()
Performs the server-side validation

Class Details

[line 42]
Class for a group of elements used to input dates (and times).


[ Top ]


Class Variables

$data = array(
        'format'           => 'dMY',
        'minYear'          => 2001,
        'maxYear'          => null, // set in the constructor
        'addEmptyOption'   => false,
        'emptyOptionValue' => '',
        'emptyOptionText'  => ' ',
        'optionIncrement'  => array('i' => 1, 's' => 1),// request #4061: max and min hours (only for 'H' modifier)
'minHour'=>0,'maxHour'=>23,// request #5957: max and min months
'minMonth'=>1,'maxMonth'=>12)

[line 53]

Various options to control the element's display.
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$language =  null

[line 73]

Language code
  • Access: protected

Type:   string


[ Top ]

$messageProvider =

[line 79]

Message provider for option texts
  • Access: protected

Type:   callback|HTML_QuickForm2_MessageProvider


[ Top ]



Method Detail

__construct (Constructor)   [line 127]

HTML_QuickForm2_Element_Date __construct( [string $name = null], [string|array $attributes = null], [array $data = array()])

Class constructor

The following keys may appear in $data array:

  • 'messageProvider': a callback or an instance of a class implementing HTML_QuickForm2_MessageProvider interface, this will be used to get localized names of months and weekdays. Some of the default ones will be used if not given.
  • 'language': date language, use 'locale' here to display month / weekday names according to the current locale.
  • 'format': Format of the date, based on PHP's date() function. The following characters are currently recognised in format string:
           D => Short names of days
           l => Long names of days
           d => Day numbers
           M => Short names of months
           F => Long names of months
           m => Month numbers
           Y => Four digit year
           y => Two digit year
           h => 12 hour format
           H => 24 hour format
           i => Minutes
           s => Seconds
           a => am/pm
           A => AM/PM
  • 'minYear': Minimum year in year select
  • 'maxYear': Maximum year in year select
  • 'addEmptyOption': Should an empty option be added to the top of each select box?
  • 'emptyOptionValue': The value passed by the empty option.
  • 'emptyOptionText': The text displayed for the empty option.
  • 'optionIncrement': Step to increase the option values by (works for 'i' and 's')
  • 'minHour': Minimum hour in hour select (only for 24 hour format!)
  • 'maxHour': Maximum hour in hour select (only for 24 hour format!)
  • 'minMonth': Minimum month in month select
  • 'maxMonth': Maximum month in month select

  • Throws: HTML_QuickForm2_InvalidArgumentException
  • Access: public

Overrides HTML_QuickForm2_Node::__construct() (Class constructor)

Parameters:

string   $name   —  Element name
string|array   $attributes   —  Attributes (either a string or an array)
array   $data   —  Element data (label, options and data used for element creation)

[ Top ]

createOptionList   [line 313]

array createOptionList( int $start, int $end, [int $step = 1])

Creates an option list containing the numbers from the start number to the end, inclusive
  • Return: An array of numeric options.
  • Access: protected

Parameters:

int   $start   —  The start number
int   $end   —  The end number
int   $step   —  Increment by this value

[ Top ]

getType   [line 44]

void getType( )

  • Access: public

Overrides HTML_QuickForm2_Container_Group::getType() (parent method not documented)
[ Top ]

setValue   [line 347]

HTML_QuickForm2_Element_Date setValue( int|string|array|DateTime $value)

Tries to convert the given value to a usable date before setting the element value
  • Access: public

Overrides HTML_QuickForm2_Container_Group::setValue() (parent method not documented)

Parameters:

int|string|array|DateTime   $value   —  A timestamp, a DateTime object, a string compatible with strtotime() or an array that fits the element names

[ Top ]

trimLeadingZeros   [line 328]

string trimLeadingZeros( string $str)

Trims leading zeros from the (numeric) string
  • Return: String with leading zeros removed
  • Access: protected

Parameters:

string   $str   —  A numeric string, possibly with leading zeros

[ Top ]

updateValue   [line 393]

void updateValue( )

Called when the element needs to update its value from form's data sources

Since the date element also accepts a timestamp as value, the default group behavior is changed.

  • Access: protected

Overrides HTML_QuickForm2_Container::updateValue() (Called when the element needs to update its value from form's data sources)
[ Top ]


Documentation generated on Wed, 10 Apr 2019 08:56:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.