PHP 클래스 Prado\Web\Services\TPageService

TPageService implements the service for serving user page requests. Pages that are available to client users are stored under a directory specified by {@link setBasePath BasePath}. The directory may contain subdirectories. Pages serving for a similar goal are usually placed under the same directory. A directory may contain a configuration file config.xml whose content is similar to that of application configuration file. A page is requested via page path, which is a dot-connected directory names appended by the page name. Assume '/Users/Admin' is the directory containing the page 'Update'. Then the page can be requested via 'Users.Admin.Update'. By default, the {@link setBasePath BasePath} of the page service is the "pages" directory under the application base path. You may change this default by setting {@link setBasePath BasePath} with a different path you prefer. Page name refers to the file name (without extension) of the page template. In order to differentiate from the common control template files, the extension name of the page template files must be '.page'. If there is a PHP file with the same page name under the same directory as the template file, that file will be considered as the page class file and the file name is the page class name. If such a file is not found, the page class is assumed as {@link TPage}. Modules can be configured and loaded in page directory configurations. Configuration of a module in a subdirectory will overwrite its parent directory's configuration, if both configurations refer to the same module. By default, TPageService will automatically load two modules: - {@link TTemplateManager} : manages page and control templates - {@link TThemeManager} : manages themes used in a Prado application In page directory configurations, static authorization rules can also be specified, which governs who and which roles can access particular pages. Refer to {@link TAuthorizationRule} for more details about authorization rules. Page authorization rules can be configured within an tag in each page directory configuration as follows, where the 'pages' attribute may be filled with a sequence of comma-separated page IDs. If 'pages' attribute does not appear in a rule, the rule will be applied to all pages in this directory and all subdirectories (recursively). Application of authorization rules are in a bottom-up fashion, starting from the directory containing the requested page up to all parent directories. The first matching rule will be used. The last rule always allows all users accessing to any resources.
부터: 3.0
저자: Qiang Xue ([email protected])
저자: Carl G. Mathisen ([email protected])
상속: extends Prado\TService
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

공개 메소드들

메소드 설명
constructUrl ( $pagePath, $getParams = null, $encodeAmpersand = true, $encodeGetItems = true ) : string Constructs a URL with specified page path and GET parameters.
getBasePageClass ( ) : string
getBasePath ( ) : string
getClientScriptManagerClass ( ) : string
getDefaultPage ( ) : string
getDefaultPageUrl ( ) : string
getRequestedPage ( ) : TPage
getRequestedPagePath ( ) : string
getTemplateManager ( ) : TTemplateManager
getThemeManager ( ) : TThemeManager
init ( $config ) Initializes the service.
run ( ) Runs the service.
setBasePageClass ( $value ) Sets the base page class name (in namespace format).
setBasePath ( $value )
setClientScriptManagerClass ( $value ) Sets the clientscript manager class (in namespace format).
setDefaultPage ( $value )
setTemplateManager ( TTemplateManager $value )
setThemeManager ( TThemeManager $value )

보호된 메소드들

메소드 설명
applyConfiguration ( $config ) Applies a page configuration.
createPage ( $pagePath ) : TPage Creates a page instance based on requested page path.
determineRequestedPagePath ( ) : string Determines the requested page path.
initPageContext ( $pageConfig ) Initializes page context.
loadPageConfig ( $config ) : TPageConfiguration Collects configuration for a page.
runPage ( $page, $properties ) Executes a page.

메소드 상세

applyConfiguration() 보호된 메소드

Applies a page configuration.
protected applyConfiguration ( $config )

constructUrl() 공개 메소드

Constructs a URL with specified page path and GET parameters.
public constructUrl ( $pagePath, $getParams = null, $encodeAmpersand = true, $encodeGetItems = true ) : string
리턴 string URL for the page and GET parameters

createPage() 보호된 메소드

Creates a page instance based on requested page path.
protected createPage ( $pagePath ) : TPage
리턴 TPage the requested page instance

determineRequestedPagePath() 보호된 메소드

Determines the requested page path.
protected determineRequestedPagePath ( ) : string
리턴 string page path requested

getBasePageClass() 공개 메소드

public getBasePageClass ( ) : string
리턴 string base page class name in namespace format. Defaults to 'TPage'.

getBasePath() 공개 메소드

public getBasePath ( ) : string
리턴 string the root directory for storing pages. Defaults to the 'pages' directory under the application base path.

getClientScriptManagerClass() 공개 메소드

부터: 3.1.7
public getClientScriptManagerClass ( ) : string
리턴 string clientscript manager class in namespace format. Defaults to 'System.Web.UI.TClientScriptManager'.

getDefaultPage() 공개 메소드

public getDefaultPage ( ) : string
리턴 string default page path to be served if no explicit page is request. Defaults to 'Home'.

getDefaultPageUrl() 공개 메소드

public getDefaultPageUrl ( ) : string
리턴 string the URL for the default page

getRequestedPage() 공개 메소드

public getRequestedPage ( ) : TPage
리턴 TPage the requested page

getRequestedPagePath() 공개 메소드

public getRequestedPagePath ( ) : string
리턴 string the requested page path

getTemplateManager() 공개 메소드

public getTemplateManager ( ) : TTemplateManager
리턴 Prado\Web\UI\TTemplateManager template manager

getThemeManager() 공개 메소드

public getThemeManager ( ) : TThemeManager
리턴 Prado\Web\UI\TThemeManager theme manager

init() 공개 메소드

This method is required by IService interface and is invoked by application.
public init ( $config )

initPageContext() 보호된 메소드

Page context includes path alias settings, namespace usages, parameter initialization, module loadings, page initial properties and authorization rules.
protected initPageContext ( $pageConfig )

loadPageConfig() 보호된 메소드

Collects configuration for a page.
protected loadPageConfig ( $config ) : TPageConfiguration
리턴 TPageConfiguration

run() 공개 메소드

This will create the requested page, initializes it with the property values specified in the configuration, and executes the page.
public run ( )

runPage() 보호된 메소드

Executes a page.
protected runPage ( $page, $properties )

setBasePageClass() 공개 메소드

If a page only has a template file without page class file, this base page class will be instantiated.
public setBasePageClass ( $value )

setBasePath() 공개 메소드

public setBasePath ( $value )

setClientScriptManagerClass() 공개 메소드

Sets the clientscript manager class (in namespace format).
부터: 3.1.7
public setClientScriptManagerClass ( $value )

setDefaultPage() 공개 메소드

public setDefaultPage ( $value )

setTemplateManager() 공개 메소드

public setTemplateManager ( TTemplateManager $value )
$value Prado\Web\UI\TTemplateManager

setThemeManager() 공개 메소드

public setThemeManager ( TThemeManager $value )
$value Prado\Web\UI\TThemeManager