TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Form\View\Form\Element\AbstractElementView Class Reference
Inheritance diagram for TYPO3\CMS\Form\View\Form\Element\AbstractElementView:
tx_form_View_Form_Element_Abstract TYPO3\CMS\Form\View\Form\Additional\AdditionalElementView TYPO3\CMS\Form\View\Form\Element\ButtonElementView TYPO3\CMS\Form\View\Form\Element\CheckboxElementView TYPO3\CMS\Form\View\Form\Element\ContainerElementView TYPO3\CMS\Form\View\Form\Element\ContentElementView TYPO3\CMS\Form\View\Form\Element\FileuploadElementView TYPO3\CMS\Form\View\Form\Element\HeaderElementView TYPO3\CMS\Form\View\Form\Element\HiddenElementView TYPO3\CMS\Form\View\Form\Element\ImagebuttonElementView TYPO3\CMS\Form\View\Form\Element\OptionElementView TYPO3\CMS\Form\View\Form\Element\PasswordElementView TYPO3\CMS\Form\View\Form\Element\RadioElementView TYPO3\CMS\Form\View\Form\Element\ResetElementView TYPO3\CMS\Form\View\Form\Element\SubmitElementView TYPO3\CMS\Form\View\Form\Element\TextareaElementView TYPO3\CMS\Form\View\Form\Element\TextblockElementView TYPO3\CMS\Form\View\Form\Element\TextlineElementView

Public Member Functions

 __construct (\TYPO3\CMS\Form\Domain\Model\Element\AbstractElement $model)
 
 render ($type='element', $returnFirstChild=TRUE)
 
 replaceNodeWithFragment (\DOMDocument $dom, \DOMNode $node, \DOMNode $value)
 
 setAttributes (\DOMElement $domElement)
 
 setAttribute (\DOMElement $domElement, $key)
 
 setAttributeWithValueofOtherAttribute (\DOMElement $domElement, $key, $other)
 
 getAdditional ($key)
 
 getElementData ($encodeSpecialCharacters=TRUE)
 
 getElementWrapId ()
 
 getElementWrapType ()
 
 getElementWraps ()
 
 noWrap ()
 

Protected Member Functions

 isValidModel (\TYPO3\CMS\Form\Domain\Model\Element\AbstractElement $model)
 
 getExpectedModelName (\TYPO3\CMS\Form\Domain\Model\Element\AbstractElement $model)
 
 parseXML (\DOMDocument $dom, \DOMNode $reference)
 
 createAdditional ($class)
 

Protected Attributes

 $model
 
 $expectedModelName
 
 $elementWrap
 
 $noWrap = FALSE
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Abstract class for the form elements view

Author
Patrick Broens patri.nosp@m.ck@p.nosp@m.atric.nosp@m.kbro.nosp@m.ens.n.nosp@m.l

Definition at line 22 of file AbstractElementView.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::__construct ( \TYPO3\CMS\Form\Domain\Model\Element\AbstractElement  $model)

Constructor

Parameters
\TYPO3\CMS\Form\Domain\Model\Element\AbstractElement$modelCurrent elements model

Definition at line 60 of file AbstractElementView.php.

References TYPO3\CMS\Form\View\Form\Element\AbstractElementView\$model, and TYPO3\CMS\Form\View\Form\Element\AbstractElementView\isValidModel().

Member Function Documentation

◆ createAdditional()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::createAdditional (   $class)
protected

Load and instantiate an additional object

Parameters
string$classType of additional
Returns
object

Definition at line 337 of file AbstractElementView.php.

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\getAdditional().

◆ getAdditional()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::getAdditional (   $key)

Create additional object by key and render the content

Parameters
string$keyType of additional
Returns

Definition at line 349 of file AbstractElementView.php.

References TYPO3\CMS\Form\View\Form\Element\AbstractElementView\createAdditional().

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\parseXML().

◆ getElementData()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::getElementData (   $encodeSpecialCharacters = TRUE)

Get the content of tags like <option>content</option> or <textarea>content</textarea>

Parameters
boolean$encodeSpecialCharactersWhether to encode the data
Returns
string

Definition at line 362 of file AbstractElementView.php.

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\parseXML().

◆ getElementWrapId()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::getElementWrapId ( )

Return the id for the element wraps, like ...

Returns
string

Definition at line 376 of file AbstractElementView.php.

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\getElementWraps().

◆ getElementWraps()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::getElementWraps ( )

◆ getElementWrapType()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::getElementWrapType ( )

Returns the type for the element wraps, like ...

Returns
string

Definition at line 388 of file AbstractElementView.php.

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\getElementWraps().

◆ getExpectedModelName()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::getExpectedModelName ( \TYPO3\CMS\Form\Domain\Model\Element\AbstractElement  $model)
protected

Gets the expected model name.

Parameters
\TYPO3\CMS\Form\Domain\Model\Element\AbstractElement$model
Returns
string

Definition at line 83 of file AbstractElementView.php.

References TYPO3\CMS\Form\View\Form\Element\AbstractElementView\$expectedModelName, and TYPO3\CMS\Form\Utility\FormUtility\getInstance().

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\isValidModel().

◆ isValidModel()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::isValidModel ( \TYPO3\CMS\Form\Domain\Model\Element\AbstractElement  $model)
protected

Determines whether the model is expected in this object.

Parameters
\TYPO3\CMS\Form\Domain\Model\Element\AbstractElement$model
Returns
boolean

Definition at line 73 of file AbstractElementView.php.

References TYPO3\CMS\Form\View\Form\Element\AbstractElementView\getExpectedModelName().

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\__construct().

◆ noWrap()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::noWrap ( )

Read the noWrap value of an element if TRUE the element does not need a element wrap like element

Returns
boolean

Definition at line 414 of file AbstractElementView.php.

References TYPO3\CMS\Form\View\Form\Element\AbstractElementView\$noWrap.

◆ parseXML()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::parseXML ( \DOMDocument  $dom,
\DOMNode  $reference 
)
protected

◆ render()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::render (   $type = 'element',
  $returnFirstChild = TRUE 
)

Get the content for the current object as DOMDocument

Parameters
string$typeType of element for layout
boolean$returnFirstChildIf TRUE, the first child will be returned instead of the DOMDocument
Returns
mixed | XML part of the view object

Definition at line 215 of file AbstractElementView.php.

References TYPO3\CMS\Form\View\Form\Element\AbstractElementView\$elementWrap, TYPO3\CMS\Form\Utility\FormUtility\getInstance(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Form\View\Form\Element\AbstractElementView\parseXML().

Referenced by TYPO3\CMS\Form\View\Form\FormView\get(), and TYPO3\CMS\Form\View\Form\Element\AbstractElementView\parseXML().

◆ replaceNodeWithFragment()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::replaceNodeWithFragment ( \DOMDocument  $dom,
\DOMNode  $node,
\DOMNode  $value 
)

Replace the current node with a document fragment

Parameters
\DOMDocument$dom
\DOMNode$nodeCurrent Node
\DOMNode$valueValue to import
Returns
void

Definition at line 275 of file AbstractElementView.php.

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\parseXML().

◆ setAttribute()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::setAttribute ( \DOMElement  $domElement,
  $key 
)

Set a single attribute of a HTML tag specified by key

Parameters
\DOMElement$domElementDOM element of the specific HTML tag
string$keyAttribute key
Returns
void

Definition at line 308 of file AbstractElementView.php.

◆ setAttributes()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::setAttributes ( \DOMElement  $domElement)

Set the attributes on the html tags according to the attributes that are assigned in the model for a certain element

Parameters
\DOMElement$domElementDOM element of the specific HTML tag
Returns
void

Definition at line 289 of file AbstractElementView.php.

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\parseXML().

◆ setAttributeWithValueofOtherAttribute()

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::setAttributeWithValueofOtherAttribute ( \DOMElement  $domElement,
  $key,
  $other 
)

Sets the value of an attribute with the value of another attribute, for instance equalizing the name and id attributes for the form tag

Parameters
\DOMElement$domElementDOM element of the specific HTML tag
string$keyKey of the attribute which needs to be changed
string$otherKey of the attribute to take the value from
Returns
unknown_type

Definition at line 324 of file AbstractElementView.php.

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\parseXML().

Member Data Documentation

◆ $elementWrap

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::$elementWrap
protected
Initial value:
= '
<li>
<element />
</li>
'

Definition at line 41 of file AbstractElementView.php.

Referenced by TYPO3\CMS\Form\View\Form\Element\AbstractElementView\render().

◆ $expectedModelName

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::$expectedModelName
protected

◆ $model

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::$model
protected

◆ $noWrap

TYPO3\CMS\Form\View\Form\Element\AbstractElementView::$noWrap = FALSE
protected