From 22471c977d4edc4ddfe63abe23928d03e659f045 Mon Sep 17 00:00:00 2001 From: "GODZilla0480@gmail.com" <> Date: Mon, 17 Oct 2011 07:36:47 +0000 Subject: Port changes of r3050 (branches/3.1) to trunk --- .../protected/pages/Configurations/UrlMapping.page | 71 +++++++++++++--------- 1 file changed, 41 insertions(+), 30 deletions(-) (limited to 'demos/quickstart') diff --git a/demos/quickstart/protected/pages/Configurations/UrlMapping.page b/demos/quickstart/protected/pages/Configurations/UrlMapping.page index c47ace28..4af61180 100644 --- a/demos/quickstart/protected/pages/Configurations/UrlMapping.page +++ b/demos/quickstart/protected/pages/Configurations/UrlMapping.page @@ -22,12 +22,12 @@ pattern will be replaced with the corresponding GET variable values. To use TUrlMapping, one must set the UrlManager property of the THttpRequest module as the TUrlMapping module ID. See following for an example, - - - - - - + + + + + +

@@ -36,9 +36,9 @@ To use TUrlMapping, one must set the UrlManager property of th 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:

@@ -69,13 +69,14 @@ using Parameters attribute collection. For example, + parameters.year="\d{4}" parameters.month="\d{2}" parameters.day="\d+" />

The example is equivalent to the following regular expression (it uses the "named group" feature in regular expressions available in PHP): - +\d{4})/(?P\d{2})/(?P\d+)#u +]]>

In the above example, the pattern contains 3 parameters named "year", @@ -83,12 +84,22 @@ In the above example, the pattern contains 3 parameters named "year", respectively, "\d{4}" (4 digits), "\d{2}" (2 digits) and "\d+" (1 or more digits). Essentially, the Parameters attribute name and values are used - as substrings in replacing the placeholders in the Pattern string +as substrings in replacing the placeholders in the Pattern string to form a complete regular expression string.

-
Note: If you intended to use the RegularExpression -property you need to escape the slash in regular expressions. +For simple (not parameterized) regular expressions you can use the RegularExpression property: + + + + +
Note: + If you intended to use the RegularExpression property or regular expressions in CDATA sections, + notice that you need to escape the slash, if you are using the slash as regular expressions delimiter. +
+ If you are using the "CDATA section" version all whitespaces like + \n, \t, \r and so on will be removed automaticly.

Following from the above pattern example, @@ -107,11 +118,11 @@ object. For example, $this->Request['year'].

The URL mapping are evaluated in order they are placed and only the first pattern 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. +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.

-

Since version 3.1.4, Prado also provides wildcard patterns to use friendly URLs +

Since version 3.1.4, Prado also provides wildcard patterns to use friendly URLs for a bunch of pages in a directory with a single rule. Therefore you can use the {*} wildcard in your pattern to let Prado know, where to find the ServiceID in your request URL. You can also specify parameters with these patterns if a lot of pages share common parameters.

@@ -124,18 +135,18 @@ parameters with these patterns if a lot of pages share common parameters.

With these rules, any of the following URLs will be recognized:

As above, put more specific rules before more common rules as the first matching rule will be used.

-

To make configuration of friendly URLs for multiple pages even easier, you can also use UrlFormat="Path" +

To make configuration of friendly URLs for multiple pages even easier, you can also use UrlFormat="Path" in combination with wildcard patterns. In fact, this feature only is available in combination with wildcard rules:

@@ -143,13 +154,13 @@ in combination with wildcard patterns. In fact, this feature only is available i -

Parameters will get appended to the specified patterns as name/value pairs, separated by a "/". +

Parameters will get appended to the specified patterns as name/value pairs, separated by a "/". (You can change the separator character with UrlParamSeparator.)

-- cgit v1.2.3