PHP Класс Prado\Web\UI\WebControls\TLabel

TLabel displays a piece of text on a Web page. Use {@link setText Text} property to set the text to be displayed. TLabel will render the contents enclosed within its component tag if {@link setText Text} is empty. To use TLabel as a form label, associate it with a control by setting the {@link setForControl ForControl} property. The associated control must be locatable within the label's naming container. If the associated control is not visible, the label will not be rendered, either. Note, {@link setText Text} will NOT be encoded for rendering. Make sure it does not contain dangerous characters that you want to avoid.
С версии: 3.0
Автор: Qiang Xue ([email protected])
Наследование: extends TWebControl, implements Prado\IDataRenderer
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getData ( ) : string Returns the text value of the label.
getForControl ( ) : string
getText ( ) : string
render ( $writer ) Renders the label.
renderContents ( $writer ) Renders the body content of the label.
setData ( $value ) Sets the text value of the label.
setForControl ( $value ) Sets the ID of the control that the label is associated with.
setText ( $value )

Защищенные методы

Метод Описание
addAttributesToRender ( $writer ) Adds attributes to renderer.
getTagName ( ) : string

Описание методов

addAttributesToRender() защищенный Метод

Adds attributes to renderer.
protected addAttributesToRender ( $writer )

getData() публичный Метод

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link getText()}.
См. также: getText
С версии: 3.1.0
public getData ( ) : string
Результат string the text value of the label

getForControl() публичный Метод

public getForControl ( ) : string
Результат string the associated control ID

getTagName() защищенный Метод

protected getTagName ( ) : string
Результат string tag name of the label, returns 'label' if there is an associated control, 'span' otherwise.

getText() публичный Метод

public getText ( ) : string
Результат string the text value of the label

render() публичный Метод

It overrides the parent implementation by checking if an associated control is visible or not. If not, the label will not be rendered.
public render ( $writer )

renderContents() публичный Метод

Renders the body content of the label.
public renderContents ( $writer )

setData() публичный Метод

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link setText()}.
См. также: setText
С версии: 3.1.0
public setData ( $value )

setForControl() публичный Метод

The control must be locatable via {@link TControl::findControl} using the ID.
public setForControl ( $value )

setText() публичный Метод

public setText ( $value )