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

Class: HTML_QuickForm2_Element_Static

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

Class Overview

HTML_Common2
   |
   --HTML_QuickForm2_Node
      |
      --HTML_QuickForm2_Element
         |
         --HTML_QuickForm2_Element_Static

Class for static elements that only contain text or markup


Author(s):

Version:

  • Release: 2.1.0

Variables

Methods


Child classes:

HTML_QuickForm2_Element_Script
Class for adding inline javascript to the form

Inherited Variables

Inherited Methods

Class: HTML_QuickForm2_Element

HTML_QuickForm2_Element::applyFilters()
Applies recursive and non-recursive filters on element value
HTML_QuickForm2_Element::getJavascriptTriggers()
HTML_QuickForm2_Element::getJavascriptValue()
Returns Javascript code for getting the element's value
HTML_QuickForm2_Element::getPersistentContent()
Generates hidden form field containing the element's value
HTML_QuickForm2_Element::render()
Renders the element using the given renderer
HTML_QuickForm2_Element::setName()
HTML_QuickForm2_Element::updateValue()
Called when the element needs to update its value from form's data sources

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 38]
Class for static elements that only contain text or markup


[ Top ]


Class Variables

$data = array('content' => '')

[line 57]

Contains options and data used for the element creation

  • content: Content of the static element

  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$forceClosingTag =  true

[line 50]

Whether to output closing tag when $tagName is set and element's content is empty
  • Access: protected

Type:   bool


[ Top ]

$tagName =  null

[line 44]

Name of the tag to wrap around static element's content
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 73]

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

Class constructor

Static element can understand the following keys in $data parameter:

  • 'content': content of the static element, e.g. text or markup
  • 'tagName': name of the tag to wrap around content, e.g. 'div'. Using tag names corresponding to form elements will cause an Exception
  • 'forceClosingTag': whether to output closing tag in case of empty content, <foo></foo> vs. <foo />

  • 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   —  Additional element data

[ Top ]

getContent   [line 160]

string getContent( )

Returns the contents of the static element

[ Top ]

getJavascriptTriggers   [line 212]

void getJavascriptTriggers( )

  • Access: public

Overrides HTML_QuickForm2_Element::getJavascriptTriggers() (parent method not documented)
[ Top ]

getJavascriptValue   [line 207]

void getJavascriptValue( [ $inContainer = false])

  • Access: public

Overrides HTML_QuickForm2_Element::getJavascriptValue() (Returns Javascript code for getting the element's value)

Parameters:

   $inContainer   — 

[ Top ]

getRawValue   [line 183]

null getRawValue( )

Static elements have no value
  • Access: public

Overrides HTML_QuickForm2_Node::getRawValue() (Returns the element's value without filters applied)
[ Top ]

getType   [line 124]

void getType( )

  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Element_Script::getType()

Overrides HTML_QuickForm2_Node::getType() (Returns the element's type)
[ Top ]

onAttributeChange   [line 97]

void onAttributeChange( string $name, [string $value = null])

Intercepts setting 'name' and 'id' attributes

Overrides parent method to allow removal of 'name' attribute on Static elements

  • Throws: HTML_QuickForm2_InvalidArgumentException if trying to remove a required attribute
  • Access: protected

Overrides HTML_QuickForm2_Node::onAttributeChange() (Intercepts setting 'name' and 'id' attributes)

Parameters:

string   $name   —  Attribute name
string   $value   —  Attribute value, null if attribute is being removed

[ Top ]

setContent   [line 149]

$this setContent( string $content)

Sets the contents of the static element

Parameters:

string   $content   —  Static content

[ Top ]

setName   [line 115]

HTML_QuickForm2_Element_Static setName( string|null $name)

Sets the element's name

Passing null here will remove the name attribute

  • Access: public

Overrides HTML_QuickForm2_Element::setName() (parent method not documented)

Parameters:

string|null   $name   — 

[ Top ]

setTagName   [line 247]

$this setTagName( string $name, [bool $forceClosing = true])

Sets the name of the HTML tag to wrap around static element's content
  • Throws: HTML_QuickForm2_InvalidArgumentException when trying to set a tag name corresponding to a form element
  • Access: public

Parameters:

string   $name   —  tag name
bool   $forceClosing   —  whether to output closing tag in case of empty contents

[ Top ]

setValue   [line 172]

$this setValue( mixed $value)

Static element's content can also be set via this method
  • Access: public

Overrides HTML_QuickForm2_Node::setValue() (Sets the element's value)

Parameters:

mixed   $value   — 

[ Top ]

toggleFrozen   [line 137]

bool toggleFrozen( [bool $freeze = null])

Static element can not be frozen
  • Return: Always returns false
  • Access: public

Overrides HTML_QuickForm2_Node::toggleFrozen() (Changes the element's frozen status)

Parameters:

bool   $freeze   —  Whether element should be frozen or editable. This parameter is ignored in case of static elements

[ Top ]

updateValue   [line 222]

void updateValue( )

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

Static elements content can be updated with default form values.

  • Access: protected

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

__toString   [line 188]

void __toString( )

  • Access: public

Overridden in child classes as:

HTML_QuickForm2_Element_Script::__toString()
Returns the element's content wrapped in <script></script> tags

[ Top ]


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