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

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

Remove a column from a table Useful for plugins making alterations

remove_column(string $class) 

Arguments

$class

string

Jump to next row

add_row(array $attr = array()) 

Arguments

$attr

array

Row attributes

Set row attributes

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

Arguments

$attr

array

Row attributes

$index

int

Optional row index (default current row index)

Get row attributes

get_row_attribs(int $index = null) : array

Arguments

$index

int

Row index

Response

array

Row attributes

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

Remove table body (all rows)

remove_body() 

Getter for the corresponding tag name for table row elements

_row_tagname() 

Getter for the corresponding tag name for table cell elements

_col_tagname() 

Generic method to create a HTML tag

tag(string $tagname, array $attrib = array(), string $content = null, array $allowed_attrib = 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_attrib

array

List with allowed attributes, omit to allow all

Response

string

The XHTML tag

doctype

doctype($type) 
inherited static

Arguments

$type

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

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

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 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

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

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 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 <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

Derrived method for line breaks

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

Arguments

$attrib

Response

string

HTML code

Create string with attributes

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

Arguments

$attrib

array

Associative arry with tag attributes

$allowed

array

List of allowed attributes

Response

string

Valid attribute string

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

Properties

tagname

tagname : 
inherited

allowed

allowed : 
inherited

header

header : 

rows

rows : 

rowindex

rowindex : 

colindex

colindex : 

attrib

attrib : 
inherited

content

content : 
inherited

doctype

doctype : 
inherited static

lc_tags

lc_tags : 
inherited static

common_attrib

common_attrib : 
inherited static

containers

containers : 
inherited static