Class YAHOO.ext.DomHelper.Template
Package: | YAHOO.ext |
Class: | DomHelper.Template |
Extends: | Object |
Defined In: | DomHelper.js |
Represents an HTML fragment template.
For more information see
this blog post with examples.
This class is also available as YAHOO.ext.Template.
Public Properties
|
re : RegExp |
DomHelper.Template |
The regular expression used to match template variables |
Public Methods
|
DomHelper.Template(String html ) |
DomHelper.Template |
|
|
append(HTMLElement el , Object values , [Boolean returnElement ]) : HTMLElement |
DomHelper.Template |
Applies the supplied values to the template and append the new node(s) to el |
|
applyTemplate(Object values ) : String |
DomHelper.Template |
Returns an HTML fragment of this template with the specified values applied |
|
compile() : void |
DomHelper.Template |
Compiles the template into an internal function, eliminating the RegEx overhead |
|
insertAfter(HTMLElement el , Object values , [Boolean returnElement ]) : HTMLElement |
DomHelper.Template |
Applies the supplied values to the template and inserts the new node(s) after el |
|
insertBefore(HTMLElement el , Object values , [Boolean returnElement ]) : HTMLElement |
DomHelper.Template |
Applies the supplied values to the template and inserts the new node(s) before el |
|
overwrite(HTMLElement el , Object values , [Boolean returnElement ]) : HTMLElement |
DomHelper.Template |
Applies the supplied values to the template and overwrites the content of el with the new node(s) |
Public Events
This class has no public events.
Property Details
re
public RegExp re
The regular expression used to match template variables
This property is defined by DomHelper.Template.
Constructor Details
DomHelper.Template
public function DomHelper.Template(String html
)
Parameters:
html
: StringThe HTML fragment
Method Details
append
public function append(HTMLElement el
, Object values
, [Boolean returnElement
])
Applies the supplied values to the template and append the new node(s) to el
This method is defined by DomHelper.Template.
applyTemplate
public function applyTemplate(Object values
)
Returns an HTML fragment of this template with the specified values applied
This method is defined by DomHelper.Template.
compile
public function compile()
Compiles the template into an internal function, eliminating the RegEx overhead
This method is defined by DomHelper.Template.
insertAfter
public function insertAfter(HTMLElement el
, Object values
, [Boolean returnElement
])
Applies the supplied values to the template and inserts the new node(s) after el
This method is defined by DomHelper.Template.
insertBefore
public function insertBefore(HTMLElement el
, Object values
, [Boolean returnElement
])
Applies the supplied values to the template and inserts the new node(s) before el
This method is defined by DomHelper.Template.
overwrite
public function overwrite(HTMLElement el
, Object values
, [Boolean returnElement
])
Applies the supplied values to the template and overwrites the content of el with the new node(s)
This method is defined by DomHelper.Template.
yui-ext - Copyright © 2006 Jack Slocum. |
Yahoo! UI - Copyright © 2006 Yahoo! Inc.
All rights reserved.