html_table

Extends \html

Class to build an HTML table

package

Framework

subpackage

View

Methods

Constructor

__construct(array $attrib = array()) 
inherited

Arguments

$attrib

array

Hash array with tag attributes

Getter for the corresponding tag name for table cell elements

_col_tagname() 

Getter for the corresponding tag name for table row elements

_head_tagname() 

Getter for the corresponding tag name for table row elements

_row_tagname() 

Derrived method for link tags

a(mixed $attr, string $cont) : string
inherited static
see \html::tag()

Arguments

$attr

mixed

Hash array with tag attributes or string with link location (href)

$cont

string

Link content

Response

string

HTML code

Add a table cell

add(array $attr, string $cont) 

Arguments

$attr

array

Cell attributes

$cont

string

Cell content

Add a table header cell

add_header(array $attr, string $cont) 

Arguments

$attr

array

Cell attributes

$cont

string

Cell content

Jump to next row

add_row(array $attr = array()) 

Arguments

$attr

array

Row attributes

Create string with attributes

attrib_string(array $attrib = array(), array $allowed = null) : string
inherited static

Arguments

$attrib

array

Associative array with tag attributes

$allowed

array

List of allowed attributes

Response

string

Valid attribute string

Derrived method for line breaks

br(array $attrib = array()) : string
inherited static
see \html::tag()

Arguments

$attrib

array

Associative arry with tag attributes

Response

string

HTML code

Derrived method for <div> containers

div(mixed $attr = null, string $cont = null) : string
inherited static
see \html::tag()

Arguments

$attr

mixed

Hash array with tag attributes or string with class name

$cont

string

Div content

Response

string

HTML code

Return DOCTYPE tag of specified type

doctype(string $type) 
inherited static

Arguments

$type

string

Document type (html5, xhtml, 'xhtml-trans, xhtml-strict)

Get row attributes

get_row_attribs(integer $index = null) : array

Arguments

$index

integer

Row index

Response

array

Row attributes

Derrived method to create <iframe></iframe>

iframe(mixed $attr = null,  $cont = null) : string
inherited static
see \html::tag()

Arguments

$attr

mixed

Hash array with tag attributes or string with frame source (src)

$cont

Response

string

HTML code

Derrived method to create <img />

img(mixed $attr = null) : string
inherited static
see \html::tag()

Arguments

$attr

mixed

Hash array with tag attributes or string with image source (src)

Response

string

HTML code

Derrived method for form element labels

label(mixed $attr, string $cont) : string
inherited static
see \html::tag()

Arguments

$attr

mixed

Hash array with tag attributes or string with 'for' attrib

$cont

string

Tag content

Response

string

HTML code

Derrived method for <p> blocks

p(mixed $attr = null, string $cont = null) : string
inherited static
see \html::tag()

Arguments

$attr

mixed

Hash array with tag attributes or string with class name

$cont

string

Paragraph content

Response

string

HTML code

Convert a HTML attribute string attributes to an associative array (name => value)

parse_attrib_string( $str) : array
inherited static

Arguments

$str

Response

array

Key-value pairs of parsed attributes

Replacing specials characters in html attribute value

quote(string $str) : string
inherited static

Arguments

$str

string

Input string

Response

string

The quoted string

Remove table body (all rows)

remove_body() 

Remove a column from a table Useful for plugins making alterations

remove_column(string $class) 

Arguments

$class

string

Derrived method to create <script> tags

script(mixed $attr, string $cont = null) : string
inherited static
see \html::tag()

Arguments

$attr

mixed

Hash array with tag attributes or string with script source (src)

$cont

string

Javascript code to be placed as tag content

Response

string

HTML code

Set row attributes

set_row_attribs(array $attr = array(), integer $index = null) 

Arguments

$attr

array

Row attributes

$index

integer

Optional row index (default current row index)

Return the tag code

show() : string
inherited

Response

string

The finally composed HTML tag

Count number of rows

size() : \The

Response

\The

number of rows

Derrived method for inline span tags

span(mixed $attr, string $cont) : string
inherited static
see \html::tag()

Arguments

$attr

mixed

Hash array with tag attributes or string with class name

$cont

string

Tag content

Response

string

HTML code

Generic method to create a HTML tag

tag(string $tagname, array $attrib = array(), string $content = null, array $allowed = null) : string
inherited static

Arguments

$tagname

string

Tag name

$attrib

array

Tag attributes as key/value pairs

$content

string

Optinal Tag content (creates a container tag)

$allowed

array

List with allowed attributes, omit to allow all

Response

string

The XHTML tag

Properties

tagname

tagname : 
inherited

Type(s)

allowed

allowed : 
inherited

Type(s)

header

header : 

Type(s)

rows

rows : 

Type(s)

rowindex

rowindex : 

Type(s)

colindex

colindex : 

Type(s)

content

content : 
inherited

Type(s)

attrib

attrib : 
inherited

Type(s)

doctype

doctype : 
inherited static

Type(s)

lc_tags

lc_tags : 
inherited static

Type(s)

common_attrib

common_attrib : 
inherited static

Type(s)

containers

containers : 
inherited static

Type(s)

bool_attrib

bool_attrib : 
inherited static

Type(s)