PHP 클래스 Prado\TApplicationComponent

TApplicationComponent is the base class for all components that are application-related, such as controls, modules, services, etc. TApplicationComponent mainly defines a few properties that are shortcuts to some commonly used methods. The {@link getApplication Application} property gives the application instance that this component belongs to; {@link getService Service} gives the current running service; {@link getRequest Request}, {@link getResponse Response} and {@link getSession Session} return the request and response modules, respectively; And {@link getUser User} gives the current user instance. Besides, TApplicationComponent defines two shortcut methods for publishing private files: {@link publishAsset} and {@link publishFilePath}.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends TComponent
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
getApplication ( ) : TApplication
getRequest ( ) : THttpRequest
getResponse ( ) : THttpResponse
getService ( ) : prado\IService
getSession ( ) : THttpSession
getUser ( ) : IUser
publishAsset ( $assetPath, $className = null ) : string Publishes a private asset and gets its URL.
publishFilePath ( $fullPath, $checkTimestamp = false ) : string Publishes a file or directory and returns its URL.

메소드 상세

getApplication() 공개 메소드

public getApplication ( ) : TApplication
리턴 TApplication current application instance

getRequest() 공개 메소드

public getRequest ( ) : THttpRequest
리턴 THttpRequest the current user request

getResponse() 공개 메소드

public getResponse ( ) : THttpResponse
리턴 THttpResponse the response

getService() 공개 메소드

public getService ( ) : prado\IService
리턴 prado\IService the current service

getSession() 공개 메소드

public getSession ( ) : THttpSession
리턴 THttpSession user session

getUser() 공개 메소드

public getUser ( ) : IUser
리턴 IUser information about the current user

publishAsset() 공개 메소드

This method will publish a private asset (file or directory) and gets the URL to the asset. Note, if the asset refers to a directory, all contents under that directory will be published. Also note, it is recommended that you supply a class name as the second parameter to the method (e.g. publishAsset($assetPath,__CLASS__) ). By doing so, you avoid the issue that child classes may not work properly because the asset path will be relative to the directory containing the child class file.
public publishAsset ( $assetPath, $className = null ) : string
리턴 string URL to the asset path.

publishFilePath() 공개 메소드

Publishes a file or directory and returns its URL.
public publishFilePath ( $fullPath, $checkTimestamp = false ) : string
리턴 string URL to the published file or directory