|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
coldbox.system.plugins.HTMLHelper
public class HTMLHelper
A cool utility that helps you when working with HTML, from creating doc types, to managing your js/css assets, to rendering tables and lists from data
| Constructor Summary | |
|---|---|
init()
|
|
| Method Summary | |
|---|---|
any |
addAsset(any asset, [boolean sendToHeader='true'])
Add a js/css asset(s) to the html head section |
any |
addJSContent(any content)
Open and close xhtml javascript tags so you can easily just add content |
any |
addStyleContent(any content)
Open and close xhtml style tags so you can easily just add content |
private void |
arrayToTable(any data, [string includes=''], [string excludes=''], any buffer)
Convert a table out of an array |
any |
br([numeric count='1'])
Generate line breaks |
any |
docType([string type='xhtml1-trans'])
Render a doctype by type name: xhtml11,xhtml1-strict,xhtml-trans,xthml-frame,html5,html4-strict,html4-trans,html4-frame |
private string |
flattenAttributes(struct target)
flatten a struct of attributes to strings |
any |
heading(string title, [numeric size='1'])
Generate header tags |
any |
img(any src, [string alt=''], [string class=''], [string width=''], [string height=''], [string title=''], [string rel=''], [boolean noBaseURL='false'])
Create image tags using the SES base URL or not |
any |
link(string href, [string rel='stylesheet'], [string type='text/css'], [string title=''], [string media=''], [boolean noBaseURL='false'])
Create link tags, using the SES base URL or not |
any |
meta(any name, [any content=''], [string type='name'])
Helps you generate meta tags |
any |
nbs([numeric count='1'])
Generate non-breaking spaces ( ) |
any |
ol(any values='', [struct attributes='[runtime expression]'], [string column=''])
Create ordered lists according to passed in values and arguments, compressed HTML |
private boolean |
passIncludeExclude(string value, [string includes=''], [string excludes=''])
checks if a list include exclude check passes |
private void |
queryToTable(any data, [string includes=''], [string excludes=''], any buffer)
Convert a table out of an array of structures |
any |
table(any data, [string includes=''], [string excludes=''], [struct attributes='[runtime expression]'])
Convert a table out of data (either a query or array of structures or array of entities) |
any |
tag(string tag, [string content=''], [struct attributes='[runtime expression]'])
Surround content with a tag |
private any |
toHTMLList(string tag, any values='', [struct attributes='[runtime expression]'], [string column=''])
Convert a sent in tag type to an HTML list |
any |
ul(any values='', [struct attributes='[runtime expression]'], [string column=''])
Create un-ordered lists according to passed in values and arguments, compressed HTML |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init()
| Method Detail |
|---|
public any addAsset(any asset, [boolean sendToHeader='true'])
asset - The asset(s) to load, only js or css files. This can also be a comma delimmited list.sendToHeader - Send to the header via htmlhead by default, else it returns the contentpublic any addJSContent(any content)
content - The content to render outpublic any addStyleContent(any content)
content - The content to render outprivate void arrayToTable(any data, [string includes=''], [string excludes=''], any buffer)
data - The array to convert into a tableincludes - The columns to include in the renderingexcludes - The columns to exclude in the renderingbufferpublic any br([numeric count='1'])
count - The number of breakspublic any docType([string type='xhtml1-trans'])
type - The doctype to generateprivate string flattenAttributes(struct target)
targetpublic any heading(string title, [numeric size='1'])
title - The header contentsize - The header size: h1, h2, hxpublic any img(any src, [string alt=''], [string class=''], [string width=''], [string height=''], [string title=''], [string rel=''], [boolean noBaseURL='false'])
src - The source URL to link to or a structure of name-value pairs to use to construct the image: [src,alt,class,width,height,title,rel]alt - The alt tagclass - The class tagwidth - The width tagheight - The height tagtitle - The title tagrel - The rel tagnoBaseURL - Prepends the setting of baseURL if falsepublic any link(string href, [string rel='stylesheet'], [string type='text/css'], [string title=''], [string media=''], [boolean noBaseURL='false'])
href - The href link or a structure of name-value pairs to render: keys [href,rel,type,title,media]rel - The rel attributetype - The type attributetitle - The title attributemedia - The media attributenoBaseURL - Prepends the setting of baseURL if falsepublic any meta(any name, [any content=''], [string type='name'])
name - A name for the meta tag or an array of struct data to convert to meta tags.Keys [name,content,type]content - The content attributetype - Either ''name'' or ''equiv'' which produces http-equiv instead of the namepublic any nbs([numeric count='1'])
count - The number of spacespublic any ol(any values='', [struct attributes='[runtime expression]'], [string column=''])
values - An array of values or list of valuesattributes - Attributes for the enclosing OL tagscolumn - If the values is a query, this is the name of the column to get the data from to create the listprivate boolean passIncludeExclude(string value, [string includes=''], [string excludes=''])
value - The value to testincludes - The columns to include in the renderingexcludes - The columns to exclude in the renderingprivate void queryToTable(any data, [string includes=''], [string excludes=''], any buffer)
data - The query to convert into a tableincludes - The columns to include in the renderingexcludes - The columns to exclude in the renderingbufferpublic any table(any data, [string includes=''], [string excludes=''], [struct attributes='[runtime expression]'])
data - The query or array of structures or array of entities to convert into a tableincludes - The columns to include in the renderingexcludes - The columns to exclude in the renderingattributes - Attributes for the enclosing table tagpublic any tag(string tag, [string content=''], [struct attributes='[runtime expression]'])
tag - The tag to generatecontent - The content of the tagattributes - The attributes to use in the tagprivate any toHTMLList(string tag, any values='', [struct attributes='[runtime expression]'], [string column=''])
tag - The list tag typevalues - An array of values or list of valuesattributes - Attributes for the enclosing list tagcolumn - If the values is a query, this is the name of the column to get the data from to create the listpublic any ul(any values='', [struct attributes='[runtime expression]'], [string column=''])
values - An array of values or list of valuesattributes - Attributes for the enclosing UL tagscolumn - If the values is a query, this is the name of the column to get the data from to create the list
|
ColdBox Platform Version 2.6.4 | ||||
| FRAMES | |||||