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

Public Member Functions

 __construct (Title $title, MessageBuilder $messageBuilder)
 
 clear ()
 
 getMessageBuilder ()
 
 setName ($name)
 
 setActionUrl ($actionUrl)
 
 withFieldset ()
 
 setMethod ($method)
 
 addQueryParameter ($key, $value)
 
 getQueryParameter ()
 
 addParagraph ($text, $attributes=array())
 
 addHorizontalRule ($attributes=array())
 
 addHeader ($level, $text)
 
 addLineBreak ()
 
 addNonBreakingSpace ()
 
 addSubmitButton ($text, $attributes=array())
 
 addInputField ($label, $inputName, $inputValue, $id=null, $length=20, $placeholder= '', $disabled=false)
 
 addHiddenField ($inputName, $inputValue)
 
 addOptionSelectList ($label, $inputName, $inputValue, $options, $id=null)
 
 addCheckbox ($label, $inputName, $inputValue, $isChecked=false, $id=null, $attributes=array())
 
 addPaging ($limit, $offset, $count, $messageCount=null)
 
 getForm ()
 

Detailed Description

Convenience class to build a html form by using a fluid interface

Example:
$htmlFormRenderer = new HtmlFormRenderer( $this->title, new MessageBuilder() );
$htmlFormRenderer
->setName( 'Foo' )
->setParameter( 'foo', 'someValue' )
->addPaging( 10, 0, 5 )
->addHorizontalRule()
->addInputField( 'BarLabel', 'bar', 'someValue' )
->addSubmitButton()
->getForm();

GNU GPL v2+

Since
2.1
Author
mwjames

Constructor & Destructor Documentation

SMW\MediaWiki\Renderer\HtmlFormRenderer::__construct ( Title  $title,
MessageBuilder  $messageBuilder 
)
Since
2.1
Parameters
Title$title
MessageBuilder$messageBuilder

Member Function Documentation

SMW\MediaWiki\Renderer\HtmlFormRenderer::addCheckbox (   $label,
  $inputName,
  $inputValue,
  $isChecked = false,
  $id = null,
  $attributes = array() 
)
Since
2.1
Parameters
string$label
string$inputName
string$inputValue
boolean$isChecked
string | null$id
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addHeader (   $level,
  $text 
)
Since
2.1
Parameters
$level
$text
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addHiddenField (   $inputName,
  $inputValue 
)
Since
2.1
Parameters
string$inputName
string$inputValue
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addHorizontalRule (   $attributes = array())
Since
2.1
Parameters
array$attributes
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addInputField (   $label,
  $inputName,
  $inputValue,
  $id = null,
  $length = 20,
  $placeholder = '',
  $disabled = false 
)
Since
2.1
Parameters
string$label
string$inputName
string$inputValue
string | null$id
integer$length
string$placeholder
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addLineBreak ( )
Since
2.1
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addNonBreakingSpace ( )
Since
2.1
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addOptionSelectList (   $label,
  $inputName,
  $inputValue,
  $options,
  $id = null 
)
Since
2.1
Parameters
string$label
string$inputName
string$inputValue
array$options
string | null$id
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addPaging (   $limit,
  $offset,
  $count,
  $messageCount = null 
)
Since
2.1
Note
Encapsulate as closure to ensure that the build contains all query parameters that are necessary to build the paging links
Parameters
integer$limit
integer$offset
integer$count
integer | null$messageCount
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addParagraph (   $text,
  $attributes = array() 
)
Since
2.1
Parameters
string$description
array$attributes
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addQueryParameter (   $key,
  $value 
)
Since
2.1
Parameters
string$key
string$value
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::addSubmitButton (   $text,
  $attributes = array() 
)
Since
2.1
Parameters
string | null$text
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::clear ( )
Since
2.1
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::getForm ( )
Since
2.1
Returns
string
SMW\MediaWiki\Renderer\HtmlFormRenderer::getMessageBuilder ( )
Since
2.1
Returns
MessageBuilder
SMW\MediaWiki\Renderer\HtmlFormRenderer::getQueryParameter ( )
Since
2.1
Returns
array
SMW\MediaWiki\Renderer\HtmlFormRenderer::setActionUrl (   $actionUrl)
Since
2.1
Parameters
string$actionUrl
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::setMethod (   $method)
Since
2.1
Parameters
string$method
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::setName (   $name)
Since
2.1
Parameters
string$name
Returns
HtmlFormRenderer
SMW\MediaWiki\Renderer\HtmlFormRenderer::withFieldset ( )
Since
2.1
Returns
HtmlFormRenderer

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