PHP Class Prado\Web\UI\WebControls\THyperLink

THyperLink displays a hyperlink on a page. The hyperlink URL is specified via the {@link setNavigateUrl NavigateUrl} property, and link text is via the {@link setText Text} property. It is also possible to display an image by setting the {@link setImageUrl ImageUrl} property. In this case, the alignment of the image displayed is set by the {@link setImageAlign ImageAlign} property and {@link getText Text} is displayed as the alternate text of the image. The link target is specified via the {@link setTarget Target} property. If both {@link getImageUrl ImageUrl} and {@link getText Text} are empty, the content enclosed within the control tag will be rendered.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TWebControl, implements Prado\IDataRenderer
ファイルを表示 Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
getData ( ) : string Returns the URL to link to when the THyperLink component is clicked.
getImageAlign ( ) : string
getImageHeight ( ) : string
getImageUrl ( ) : string
getImageWidth ( ) : string
getNavigateUrl ( ) : string
getTarget ( ) : string
getText ( ) : string
renderContents ( $writer ) Renders the body content of the hyperlink.
setData ( $value ) Sets the URL to link to when the THyperLink component is clicked.
setImageAlign ( $value ) Sets the alignment of the image with respective to other elements on the page.
setImageHeight ( $value ) Sets the height of the image in the THyperLink
setImageUrl ( $value ) Sets the location of image file of the THyperLink.
setImageWidth ( $value ) Sets the width of the image in the THyperLink
setNavigateUrl ( $value ) Sets the URL to link to when the THyperLink component is clicked.
setTarget ( $value ) Sets the target window or frame to display the Web page content linked to when the THyperLink component is clicked.
setText ( $value ) Sets the text caption of the THyperLink.

Protected Methods

Method Description
addAttributesToRender ( $writer ) Adds attributes related to a hyperlink element to renderer.
createImage ( $imageUrl ) : TImage Gets the TImage for rendering the ImageUrl property. This is not for creating dynamic images.
getTagName ( ) : string

Method Details

addAttributesToRender() protected method

Adds attributes related to a hyperlink element to renderer.
protected addAttributesToRender ( $writer )

createImage() protected method

Gets the TImage for rendering the ImageUrl property. This is not for creating dynamic images.
protected createImage ( $imageUrl ) : TImage
return TImage image control for rendering.

getData() public method

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link getText()}.
See also: getText
Since: 3.1.0
public getData ( ) : string
return string the text caption

getImageAlign() public method

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

getImageHeight() public method

public getImageHeight ( ) : string
return string height of the image in the THyperLink

getImageUrl() public method

public getImageUrl ( ) : string
return string the location of the image file for the THyperLink

getImageWidth() public method

public getImageWidth ( ) : string
return string width of the image in the THyperLink

getNavigateUrl() public method

public getNavigateUrl ( ) : string
return string the URL to link to when the THyperLink component is clicked.

getTagName() protected method

protected getTagName ( ) : string
return string tag name of the hyperlink

getTarget() public method

public getTarget ( ) : string
return string the target window or frame to display the Web page content linked to when the THyperLink component is clicked.

getText() public method

public getText ( ) : string
return string the text caption of the THyperLink

renderContents() public method

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

setData() public method

This method is required by {@link \Prado\IDataRenderer}. It is the same as {@link setText()}.
See also: setText
Since: 3.1.0
public setData ( $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 )

setImageHeight() public method

Sets the height of the image in the THyperLink
public setImageHeight ( $value )

setImageUrl() public method

Sets the location of image file of the THyperLink.
public setImageUrl ( $value )

setImageWidth() public method

Sets the width of the image in the THyperLink
public setImageWidth ( $value )

setNavigateUrl() public method

Sets the URL to link to when the THyperLink component is clicked.
public setNavigateUrl ( $value )

setTarget() public method

Sets the target window or frame to display the Web page content linked to when the THyperLink component is clicked.
public setTarget ( $value )

setText() public method

Sets the text caption of the THyperLink.
public setText ( $value )