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

Class: HTML_Template_Flexy_Element

Source Location: /HTML_Template_Flexy-1.3.13/HTML/Template/Flexy/Element.php

Class Overview


Lightweight HTML Element builder and render


Author(s):

Version:

  • 1.6

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 56]
Lightweight HTML Element builder and render

This differs from HTML_Common in the following ways:

$element->attributes is Public $element->override if set to anything other than false, renders the value rather than the defined element

$element->children is a recursvable child array which is rendered by toHTML $element->toHtml() is implemented $element->toHtmlNoClose() renders only the first tag and children (designed for <form No support for tab offsets, comments ...

Full support for Select, and common Form elements using setValue() setOptions()

overlay support with SetFrom - base + inherited..

attributes array values: key="value" // standard key="value" in output key = true // outputs just key.

children can be another HTML_Element or string (raw text)



[ Top ]


Class Variables

$attributes = array()

[line 75]

Associative array of table attributes

Note Special values: true == only display the key false == remove

  • Access: public

Type:   array


[ Top ]

$children = array()

[line 83]

Sequence array of children

children that are strings are assumed to be text

  • Access: public

Type:   array


[ Top ]

$label =  null

[line 123]

If an input element has a label element associated to it *and* the 'useElementLabels' option is true, then you can optionally set the text of this label. This permits to set custom strings for doing translations.
  • Var: | null
  • Access: public

Type:   string


[ Top ]

$override =  false

[line 92]

override the tag.

if this is set to anything other than false, it will be output rather than the tags+children

  • Access: public

Type:   array


[ Top ]

$tag =   ''

[line 65]

Tag that this Element represents.
  • Access: public

Type:   array


[ Top ]

$value =  null

[line 114]

a value for delayed merging into live objects if you set this on an element, it is merged by setValue, at merge time.
  • Access: public

Type:   array


[ Top ]



Method Detail

HTML_Template_Flexy_Element (Constructor)   [line 130]

HTML_Template_Flexy_Element HTML_Template_Flexy_Element( [ $tag = ''], [mixed $attributes = null])

Class constructor
  • Access: public

Parameters:

mixed   $attributes   —  Associative array of table tag attributes or HTML attributes name="value" pairs
   $tag   — 

[ Top ]

childrenToHtml   [line 707]

string childrenToHtml( )

Output HTML and children
  • Abstract:
  • Access: public

[ Top ]

clearOptions   [line 554]

bool clearOptions( [ $children = array()])

Removes all of this element's options

Validates that $this element is "select"

  • Return: result
  • Access: public

Parameters:

   $children   — 

[ Top ]

getOptions   [line 521]

array getOptions( )

Returns THIS select element's options as an associative array

Validates that $this element is "select"

  • Access: public

[ Top ]

merge   [line 731]

HTML_Template_Flexy_Element merge( HTML_Template_Flexy_Element $new)

merge this element with another originally was in main engine
  • Return: the combined/merged data.
  • Access: public

Parameters:

HTML_Template_Flexy_Element   $new   —  (with data to replace/merge)

[ Top ]

removeAttributes   [line 605]

void removeAttributes( $attrs, string $attr)

Removes an attributes
  • Since: 1.4
  • Throws:
  • Access: public

Parameters:

string   $attr   —  Attribute name
   $attrs   — 

[ Top ]

setAttributes   [line 585]

void setAttributes( mixed $attributes)

Sets the HTML attributes
  • Access: public

Parameters:

mixed   $attributes   —  Either a typical HTML attribute string or an associative array

[ Top ]

setOptions   [line 457]

void setOptions( $array, [HTML_Element $noValue = false], HTML_Element $from)

Utility function equivilant to HTML_Select - loadArray **

but using key=>value maps <option value="key">Value</option> Key=key (eg. both the same) maps to <option>key</option> and label = array(key=>value) maps to <optgroup label="label"> <option value="key">value</option></optgroup>

$element->setOptions(array('a'=>'xxx','b'=>'yyy')); or $element->setOptions(array('a','b','c','d'),true);

.

  • Access: public

Parameters:

HTML_Element   $from   —  override settings from another element.
HTML_Element   $noValue   —  ignore the key part of the array
   $array   — 

[ Top ]

setValue   [line 263]

void setValue( $value, HTML_Element $from)

Utility function to set values from common tag types.
  • Access: public

Parameters:

HTML_Element   $from   —  override settings from another element.
   $value   — 

[ Top ]

toHtml   [line 626]

string toHtml( [object $overlay = false])

Output HTML and children
  • Abstract:
  • Access: public

Parameters:

object   $overlay   —  = merge data from object.

[ Top ]

toHtmlnoClose   [line 683]

string toHtmlnoClose( [object $overlay = false])

Output Open Tag and any children and not Child tag (designed for use with <form + hidden elements>
  • Abstract:
  • Access: public

Parameters:

object   $overlay   —  = merge data from object.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:59:56 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.