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=[])
 
 addHorizontalRule ( $attributes=[])
 
 addHeader ( $level, $text)
 
 addLineBreak ()
 
 addNonBreakingSpace ()
 
 addSubmitButton ( $text, $attributes=[])
 
 openElement ( $element='div', array $attributes=[])
 
 closeElement ( $element='div', array $attributes=[])
 
 addInputField ( $label, $name, $value, $id=null, $size=20, array $attributes=[])
 
 addHiddenField ( $inputName, $inputValue)
 
 addOptionSelectList ( $label, $inputName, $inputValue, $options, $id=null)
 
 addCheckbox ( $label, $inputName, $inputValue, $isChecked=false, $id=null, $attributes=[])
 
 addPaging ( $limit, $offset, $count, $messageCount=null)
 
 getForm ()
 
 renderForm ()
 

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

◆ __construct()

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

Member Function Documentation

◆ addCheckbox()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addCheckbox (   $label,
  $inputName,
  $inputValue,
  $isChecked = false,
  $id = null,
  $attributes = [] 
)
Since
2.1
Parameters
string$label
string$inputName
string$inputValue
boolean$isChecked
string | null$id
Returns
HtmlFormRenderer

◆ addHeader()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addHeader (   $level,
  $text 
)
Since
2.1
Parameters
$level
$text
Returns
HtmlFormRenderer

◆ addHiddenField()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addHiddenField (   $inputName,
  $inputValue 
)
Since
2.1
Parameters
string$inputName
string$inputValue
Returns
HtmlFormRenderer

◆ addHorizontalRule()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addHorizontalRule (   $attributes = [])
Since
2.1
Parameters
array$attributes
Returns
HtmlFormRenderer

◆ addInputField()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addInputField (   $label,
  $name,
  $value,
  $id = null,
  $size = 20,
array  $attributes = [] 
)
Since
2.1
Parameters
string$label
string$name
string$value
string | null$id
integer$length
array$attributes
Returns
HtmlFormRenderer

◆ addLineBreak()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addLineBreak ( )
Since
2.1
Returns
HtmlFormRenderer

◆ addNonBreakingSpace()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addNonBreakingSpace ( )
Since
2.1
Returns
HtmlFormRenderer

◆ addOptionSelectList()

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

◆ addPaging()

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

◆ addParagraph()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addParagraph (   $text,
  $attributes = [] 
)
Since
2.1
Parameters
string$description
array$attributes
Returns
HtmlFormRenderer

◆ addQueryParameter()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addQueryParameter (   $key,
  $value 
)
Since
2.1
Parameters
string$key
string$value
Returns
HtmlFormRenderer

◆ addSubmitButton()

SMW\MediaWiki\Renderer\HtmlFormRenderer::addSubmitButton (   $text,
  $attributes = [] 
)
Since
2.1
Parameters
string | null$text
Returns
HtmlFormRenderer

◆ clear()

SMW\MediaWiki\Renderer\HtmlFormRenderer::clear ( )
Since
2.1
Returns
HtmlFormRenderer

◆ closeElement()

SMW\MediaWiki\Renderer\HtmlFormRenderer::closeElement (   $element = 'div',
array  $attributes = [] 
)
Since
3.0
Parameters
string$element
array$attributes
Returns
HtmlFormRenderer

◆ getForm()

SMW\MediaWiki\Renderer\HtmlFormRenderer::getForm ( )
Since
2.1
Returns
string

◆ getMessageBuilder()

SMW\MediaWiki\Renderer\HtmlFormRenderer::getMessageBuilder ( )
Since
2.1
Returns
MessageBuilder

◆ getQueryParameter()

SMW\MediaWiki\Renderer\HtmlFormRenderer::getQueryParameter ( )
Since
2.1
Returns
array

◆ openElement()

SMW\MediaWiki\Renderer\HtmlFormRenderer::openElement (   $element = 'div',
array  $attributes = [] 
)
Since
3.0
Parameters
string$element
array$attributes
Returns
HtmlFormRenderer

◆ renderForm()

SMW\MediaWiki\Renderer\HtmlFormRenderer::renderForm ( )
Since
3.0
Returns
string

◆ setActionUrl()

SMW\MediaWiki\Renderer\HtmlFormRenderer::setActionUrl (   $actionUrl)
Since
2.1
Parameters
string$actionUrl
Returns
HtmlFormRenderer

◆ setMethod()

SMW\MediaWiki\Renderer\HtmlFormRenderer::setMethod (   $method)
Since
2.1
Parameters
string$method
Returns
HtmlFormRenderer

◆ setName()

SMW\MediaWiki\Renderer\HtmlFormRenderer::setName (   $name)
Since
2.1
Parameters
string$name
Returns
HtmlFormRenderer

◆ withFieldset()

SMW\MediaWiki\Renderer\HtmlFormRenderer::withFieldset ( )
Since
2.1
Returns
HtmlFormRenderer

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

About | General disclaimer | Privacy policy