PHP 클래스 Prado\Web\UI\TTemplateControl

TTemplateControl is the base class for all controls that use templates. By default, a control template is assumed to be in a file under the same directory with the control class file. They have the same file name and different extension name. For template file, the extension name is ".tpl".
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TCompositeControl
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
createChildControls ( ) Creates child controls.
getIsSourceTemplateControl ( ) : boolean
getMaster ( ) : TTemplateControl | null
getMasterClass ( ) : string
getTemplate ( ) : Prado\Web\UI\ITemplate | null Returns the template object associated with this control object.
getTemplateDirectory ( ) : string
injectContent ( $id, $content ) Injects all content controls (and their children) to the corresponding content placeholders.
registerContent ( $id, TContent $object ) Registers a content control.
registerContentPlaceHolder ( $id, TContentPlaceHolder $object ) Registers a content placeholder to this template control.
setMasterClass ( $value )
setTemplate ( $value ) Sets the parsed template.
tryToUpdateAR ( TActiveRecord $arObj, boolean $throwExceptions = false ) Function to try to update an AR object with data in view controls.
tryToUpdateView ( TActiveRecord $arObj, boolean $throwExceptions = false ) Function to update view controls with data in a given AR object.

보호된 메소드들

메소드 설명
initRecursive ( $namingContainer = null ) Performs the OnInit step for the control and all its child controls.
loadTemplate ( ) : Prado\Web\UI\ITemplate Loads the template associated with this control class.

메소드 상세

createChildControls() 공개 메소드

This method is overridden to load and instantiate control template. This method should only be used by framework and control developers.
public createChildControls ( )

getIsSourceTemplateControl() 공개 메소드

public getIsSourceTemplateControl ( ) : boolean
리턴 boolean whether this control is a source template control. A source template control loads its template from external storage, such as file, db, rather than from within another template.

getMaster() 공개 메소드

public getMaster ( ) : TTemplateControl | null
리턴 TTemplateControl | null master control associated with this control, null if none

getMasterClass() 공개 메소드

public getMasterClass ( ) : string
리턴 string master class name (in namespace form)

getTemplate() 공개 메소드

Returns the template object associated with this control object.
public getTemplate ( ) : Prado\Web\UI\ITemplate | null
리턴 Prado\Web\UI\ITemplate | null the parsed template, null if none

getTemplateDirectory() 공개 메소드

public getTemplateDirectory ( ) : string
리턴 string the directory containing the template. Empty if no template available.

initRecursive() 보호된 메소드

This method overrides the parent implementation by ensuring child controls are created first, and if master class is set, master will be applied. Only framework developers should use this method.
protected initRecursive ( $namingContainer = null )

injectContent() 공개 메소드

This method should only be used by framework and control developers.
public injectContent ( $id, $content )

loadTemplate() 보호된 메소드

Loads the template associated with this control class.
protected loadTemplate ( ) : Prado\Web\UI\ITemplate
리턴 Prado\Web\UI\ITemplate the parsed template structure

registerContent() 공개 메소드

Registers a content control.
public registerContent ( $id, TContent $object )
$object Prado\Web\UI\WebControls\TContent

registerContentPlaceHolder() 공개 메소드

This method should only be used by framework and control developers.
public registerContentPlaceHolder ( $id, TContentPlaceHolder $object )
$object Prado\Web\UI\WebControls\TContentPlaceHolder

setMasterClass() 공개 메소드

public setMasterClass ( $value )

setTemplate() 공개 메소드

Note, the template will be applied to the whole control class. This method should only be used by framework and control developers.
public setTemplate ( $value )

tryToUpdateAR() 공개 메소드

Function to try to update an AR object with data in view controls.
저자: Daniel Sampedro ([email protected])
public tryToUpdateAR ( TActiveRecord $arObj, boolean $throwExceptions = false )
$arObj TActiveRecord
$throwExceptions boolean Wheter or not to throw exceptions

tryToUpdateView() 공개 메소드

View controls and AR object need to have the same name in IDs and Attrs respectively.
저자: Daniel Sampedro ([email protected])
public tryToUpdateView ( TActiveRecord $arObj, boolean $throwExceptions = false )
$arObj TActiveRecord
$throwExceptions boolean Wheter or not to throw exceptions