PHP Class Prado\Web\UI\WebControls\TImage

TImage displays an image on a page. The image is specified via the {@link setImageUrl ImageUrl} property which takes a relative or absolute URL to the image file. The alignment of the image displayed is set by the {@link setImageAlign ImageAlign} property. To set alternative texts or long description of the image, use {@link setAlternateText AlternateText} or {@link setDescriptionUrl DescriptionUrl} property, respectively.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TWebControl, implements Prado\IDataRenderer
Datei anzeigen Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
getAlternateText ( ) : string
getData ( ) : string Returns the URL of the image file.
getDescriptionUrl ( ) : string
getImageAlign ( ) : string
getImageUrl ( ) : string
renderContents ( $writer ) Renders the body content of the image.
setAlternateText ( $value ) Sets the alternative text to be displayed in the TImage when the image is unavailable.
setData ( $value ) Sets the URL of the image.
setDescriptionUrl ( $value )
setImageAlign ( $value ) Sets the alignment of the image with respective to other elements on the page.
setImageUrl ( $value )

Protected Methods

Method Description
addAttributesToRender ( $writer ) Adds attributes related to an HTML image element to renderer.
getTagName ( ) : string

Method Details

addAttributesToRender() protected method

Adds attributes related to an HTML image element to renderer.
protected addAttributesToRender ( $writer )

getAlternateText() public method

public getAlternateText ( ) : string
return string the alternative text displayed in the TImage component when the image is unavailable.

getData() public method

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link getImageUrl()}.
See also: getImageUrl
Since: 3.1.0
public getData ( ) : string
return string the URL of the image file.

getDescriptionUrl() public method

public getDescriptionUrl ( ) : string
return string the URL to long description

getImageAlign() public method

public getImageAlign ( ) : string
return string the alignment of the image with respective to other elements on the page, defaults to empty.

getImageUrl() public method

public getImageUrl ( ) : string
return string the URL of the image file

getTagName() protected method

protected getTagName ( ) : string
return string tag name of image control

renderContents() public method

Nothing to be rendered within image tags.
public renderContents ( $writer )

setAlternateText() public method

Sets the alternative text to be displayed in the TImage when the image is unavailable.
public setAlternateText ( $value )

setData() public method

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link setImageUrl()}.
See also: setImageUrl
Since: 3.1.0
public setData ( $value )

setDescriptionUrl() public method

public setDescriptionUrl ( $value )

setImageAlign() public method

Possible values include: absbottom, absmiddle, baseline, bottom, left, middle, right, texttop, and top. If an empty string is passed in, imagealign attribute will not be rendered.
public setImageAlign ( $value )

setImageUrl() public method

public setImageUrl ( $value )