Semantic MediaWiki and related extensions
Public Member Functions | List of all members
SMW\MediaWiki\Renderer\HtmlTableRenderer Class Reference

Public Member Functions

 __construct ($htmlContext=false)
 
 setHtmlContext ($htmlContext)
 
 transpose ($transpose=true)
 
 addHeaderItem ($element, $content= '', $attributes=array())
 
 getHeaderItems ()
 
 addCell ($content= '', $attributes=array())
 
 addHeader ($content= '', $attributes=array())
 
 addRow ($attributes=array())
 
 getHtml ($attributes=array())
 

Detailed Description

GNU GPL v2+

Since
1.9
Author
mwjames

Constructor & Destructor Documentation

SMW\MediaWiki\Renderer\HtmlTableRenderer::__construct (   $htmlContext = false)
Example:
$tableBuilder = new TableBuilder();
$tableBuilder
->addHeader( 'Foo' )
->addHeader( 'Bar' )
->addCell( 'Lula' )
->addCell( 'Lala' )
->addRow();
$tableBuilder->getHtml()
Since
1.9
Parameters
boolean$htmlContext

Member Function Documentation

SMW\MediaWiki\Renderer\HtmlTableRenderer::addCell (   $content = '',
  $attributes = array() 
)

Collects and adds table cells

Since
1.9
Parameters
string$content
array$attributes
Returns
TableBuilder
SMW\MediaWiki\Renderer\HtmlTableRenderer::addHeader (   $content = '',
  $attributes = array() 
)

Collects and adds table headers

Since
1.9
Parameters
string$content
array$attributes
Returns
TableBuilder
SMW\MediaWiki\Renderer\HtmlTableRenderer::addHeaderItem (   $element,
  $content = '',
  $attributes = array() 
)

Adds an arbitrary header item to an internal array

Since
1.9
Parameters
string$element
string$content
array$attributes
Returns
string
SMW\MediaWiki\Renderer\HtmlTableRenderer::addRow (   $attributes = array())

Build a row from invoked cells, copy them into a new associated array and delete those cells as they are now part of a row

Example:
...
$TableBuilder->addCell( 'Lula' )->addCell( 'Lala' )->addRow()
...
Since
1.9
Parameters
array$attributes
Returns
TableBuilder
SMW\MediaWiki\Renderer\HtmlTableRenderer::getHeaderItems ( )

Returns concatenated header items

Since
1.9
Returns
string
SMW\MediaWiki\Renderer\HtmlTableRenderer::getHtml (   $attributes = array())

Returns a table

Since
1.9
Parameters
array$attributes
Returns
string
SMW\MediaWiki\Renderer\HtmlTableRenderer::setHtmlContext (   $htmlContext)
Since
2.1
Parameters
boolean$htmlContext
SMW\MediaWiki\Renderer\HtmlTableRenderer::transpose (   $transpose = true)
Since
1.9
Parameters
boolean$transpose
Returns
TableBuilder

The documentation for this class was generated from the following file: