PHP 클래스 Prado\Web\UI\WebControls\TWebControl

TWebControl is the base class for controls that share a common set of UI-related properties and methods. TWebControl-derived controls are usually associated with HTML tags. They thus have tag name, attributes and body contents. You can override {@link getTagName} to specify the tag name, {@link addAttributesToRender} to specify the attributes to be rendered, and {@link renderContents} to customize the body content rendering. TWebControl encapsulates a set of properties related with CSS style fields, such as {@link getBackColor BackColor}, {@link getBorderWidth BorderWidth}, etc. Subclasses of TWebControl typically needs to override {@link addAttributesToRender} and {@link renderContents}. The former is used to render the attributes of the HTML tag associated with the control, while the latter is to render the body contents enclosed within the HTML tag.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends Prado\Web\UI\TControl, implements Prado\Web\UI\WebControls\IStyleable
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_decorator this render things before and after both the open and close tag

공개 메소드들

메소드 설명
clearStyle ( ) Removes all style data.
copyBaseAttributes ( TWebControl $control ) Copies basic control attributes from another control.
getAccessKey ( ) : string
getBackColor ( ) : string
getBorderColor ( ) : string
getBorderStyle ( ) : string
getBorderWidth ( ) : string
getCssClass ( ) : string
getDecorator ( $create = true ) : TWebControlDecorator
getDisplay ( ) : TDisplayStyle
getEnsureId ( ) : whether
getFont ( ) : TFont
getForeColor ( ) : string
getHasStyle ( ) : boolean
getHeight ( ) : string
getStyle ( ) : TStyle
getTabIndex ( ) : integer
getToolTip ( ) : string
getWidth ( ) : string
onPreRender ( $param ) If your subclass overrides the onPreRender method be sure to call this method through parent::onPreRender($param); so your sub-class can be decorated, among other things.
render ( $writer ) Renders the control.
renderBeginTag ( $writer ) Renders the openning tag for the control (including attributes)
renderContents ( $writer ) Renders the body content enclosed between the control tag.
renderEndTag ( $writer ) Renders the closing tag for the control
setAccessKey ( $value ) Sets the access key of the control.
setBackColor ( $value )
setBorderColor ( $value )
setBorderStyle ( $value )
setBorderWidth ( $value )
setCssClass ( $value )
setDisplay ( $value )
setEnsureId ( $value ) Subclasses can override getEnsureId or just set this property. eg. If your subclass control does work with javascript and your class wants to flag that it requires an id to operate properly. Once set to true, it stays that way.
setForeColor ( $value )
setHeight ( $value )
setStyle ( $value ) Sets the css style string of the control.
setTabIndex ( $value ) Sets the tab index of the control.
setToolTip ( $value ) Sets the tooltip of the control.
setWidth ( $value )

보호된 메소드들

메소드 설명
addAttributesToRender ( $writer ) Adds attribute name-value pairs to renderer.
createStyle ( ) : TStyle Creates a style object to be used by the control.
getTagName ( ) : string Returns the tag name used for this control.

메소드 상세

addAttributesToRender() 보호된 메소드

By default, the method will render 'id', 'accesskey', 'disabled', 'tabindex', 'title' and all custom attributes. The method can be overriden to provide customized attribute rendering.
protected addAttributesToRender ( $writer )

clearStyle() 공개 메소드

Removes all style data.
public clearStyle ( )

copyBaseAttributes() 공개 메소드

Properties including AccessKey, ToolTip, TabIndex, Enabled and Attributes are copied.
public copyBaseAttributes ( TWebControl $control )
$control TWebControl

createStyle() 보호된 메소드

This method may be overriden by controls to provide customized style.
protected createStyle ( ) : TStyle
리턴 TStyle the default style created for TWebControl

getAccessKey() 공개 메소드

public getAccessKey ( ) : string
리턴 string the access key of the control

getBackColor() 공개 메소드

public getBackColor ( ) : string
리턴 string the background color of the control

getBorderColor() 공개 메소드

public getBorderColor ( ) : string
리턴 string the border color of the control

getBorderStyle() 공개 메소드

public getBorderStyle ( ) : string
리턴 string the border style of the control

getBorderWidth() 공개 메소드

public getBorderWidth ( ) : string
리턴 string the border width of the control

getCssClass() 공개 메소드

public getCssClass ( ) : string
리턴 string the css class of the control

getDecorator() 공개 메소드

public getDecorator ( $create = true ) : TWebControlDecorator
리턴 TWebControlDecorator

getDisplay() 공개 메소드

public getDisplay ( ) : TDisplayStyle
리턴 TDisplayStyle display style of the control, default is TDisplayStyle::Fixed

getEnsureId() 공개 메소드

public getEnsureId ( ) : whether
리턴 whether this web control must have an id

getFont() 공개 메소드

public getFont ( ) : TFont
리턴 TFont the font of the control

getForeColor() 공개 메소드

public getForeColor ( ) : string
리턴 string the foreground color of the control

getHasStyle() 공개 메소드

public getHasStyle ( ) : boolean
리턴 boolean whether the control has defined any style information

getHeight() 공개 메소드

public getHeight ( ) : string
리턴 string the height of the control

getStyle() 공개 메소드

public getStyle ( ) : TStyle
리턴 TStyle the object representing the css style of the control

getTabIndex() 공개 메소드

public getTabIndex ( ) : integer
리턴 integer the tab index of the control

getTagName() 보호된 메소드

By default, the tag name is 'span'. You can override this method to provide customized tag names.
protected getTagName ( ) : string
리턴 string tag name of the control to be rendered

getToolTip() 공개 메소드

public getToolTip ( ) : string
리턴 string the tooltip of the control

getWidth() 공개 메소드

public getWidth ( ) : string
리턴 string the width of the control

onPreRender() 공개 메소드

If your subclass overrides the onPreRender method be sure to call this method through parent::onPreRender($param); so your sub-class can be decorated, among other things.
public onPreRender ( $param )

render() 공개 메소드

This method overrides the parent implementation by replacing it with the following sequence: - {@link renderBeginTag} - {@link renderContents} - {@link renderEndTag}
public render ( $writer )

renderBeginTag() 공개 메소드

Renders the openning tag for the control (including attributes)
public renderBeginTag ( $writer )

renderContents() 공개 메소드

By default, child controls and text strings will be rendered. You can override this method to provide customized content rendering.
public renderContents ( $writer )

renderEndTag() 공개 메소드

Renders the closing tag for the control
public renderEndTag ( $writer )

setAccessKey() 공개 메소드

Only one-character string can be set, or an exception will be raised. Pass in an empty string if you want to disable access key.
public setAccessKey ( $value )

setBackColor() 공개 메소드

public setBackColor ( $value )

setBorderColor() 공개 메소드

public setBorderColor ( $value )

setBorderStyle() 공개 메소드

public setBorderStyle ( $value )

setBorderWidth() 공개 메소드

public setBorderWidth ( $value )

setCssClass() 공개 메소드

public setCssClass ( $value )

setDisplay() 공개 메소드

public setDisplay ( $value )

setEnsureId() 공개 메소드

Subclasses can override getEnsureId or just set this property. eg. If your subclass control does work with javascript and your class wants to flag that it requires an id to operate properly. Once set to true, it stays that way.
public setEnsureId ( $value )

setForeColor() 공개 메소드

public setForeColor ( $value )

setHeight() 공개 메소드

public setHeight ( $value )

setStyle() 공개 메소드

The style string will be prefixed to the styles set via other control properties (e.g. Height, Width).
public setStyle ( $value )

setTabIndex() 공개 메소드

Pass 0 if you want to disable tab index.
public setTabIndex ( $value )

setToolTip() 공개 메소드

Pass an empty string if you want to disable tooltip.
public setToolTip ( $value )

setWidth() 공개 메소드

public setWidth ( $value )

프로퍼티 상세

$_decorator 보호되어 있는 프로퍼티

this render things before and after both the open and close tag
protected $_decorator