From c6290af5ce4d4f841f487284fe6d9dc405bd0757 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 3 Dec 2006 13:21:04 +0000 Subject: updated tutorial about TUrlMapping. --- .../protected/pages/Configurations/UrlMapping.page | 44 ++++++++++++++++------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/demos/quickstart/protected/pages/Configurations/UrlMapping.page b/demos/quickstart/protected/pages/Configurations/UrlMapping.page index ff6f09c7..112d70e2 100644 --- a/demos/quickstart/protected/pages/Configurations/UrlMapping.page +++ b/demos/quickstart/protected/pages/Configurations/UrlMapping.page @@ -25,21 +25,36 @@ This usually means delcaring the TUrlMapping module before any Specifying the mappings in the per directory config.xml is not supported. -

The mapping format is as follows. +

+To use TUrlMapping, one must set the UrlManager property of the THttpRequest module as the TUrlMapping module ID. See following for an example, - - - + + + + + + + +

-

The ServiceParameter and ServiceID - (the default ID is 'page') set the service parameter and service ID, respectively, of - the Request module. - The service parameter for the TPageService service is the - Page class name, e.g., for an URL "index.php?page=Home", "page" is the service ID and the service - parameter is "Home". Other services may use the service parameter and ID differently. -See Services for further details. +

+The above example is part of the application configuration of the blog demo in the PRADO release. It enables recognition of the following URL formats: +

+ + +

+The ServiceParameter and ServiceID (the default ID is 'page') set the service parameter and service ID, respectively, of the Request module. The service parameter for the TPageService service is the Page class name, e.g., for an URL "index.php?page=Home", "page" is the service ID and the service parameter is "Home". Other services may use the service parameter and ID differently. See Services for further details. +

+ +

Specifying URL Patterns

+

+TUrlMapping enables recognition of customized URL formats based on a list prespecified of URL patterns. Each pattern is specified in a <url> tag.

@@ -95,6 +110,11 @@ object. For example, $this->Request['year'].

The URL mapping are evaluated in order they are place and only the first mapping that matches the URL will be used. Cascaded mapping can be achieved by placing the URL mappings in particular order. For example, placing the most specific mappings first. -

+

+ +

Constructing Customized URLs

+

+Since version 3.0.6, TUrlMapping starts to support constructing customized URL formats. This is achieved by allowing users to extend TUrlMapping class and override the constructUrl method. In the applications, users can still use THttpRequest.constructUrl() or TPageService.constructUrl() to generate PRADO-recognizable URLS. The actual URL construction work is ultimately delegated to the TUrlMapping.constructUrl(), provided it is implemented. +

\ No newline at end of file -- cgit v1.2.3