tel8618217223380 / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Feature Request: Add support for fully qualified URL-matching in TUrlMapping #205

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
TUrlMapping (well, actually TUrlMappingPattern) currently only supports 
mapping based on the "pathinfo" part of the url, and provides no way to 
provide any mapping which also considers any parameters passed to the 
script in the "querystring" part of the url. I however fail to see why 
this limitation is there. Without this, one must fall back to 
use .htaccess rewrite techniques, contradicting the primary purpose of 
Prado's url mapping (which in my understanding is allowing developers to 
avoid those url rewrites from config, and moving that logic integral to 
the application), in cases where for ex. you want to have calls diverted 
to different pages based on specific query parameter values in the url. 
(For ex. you might have moved the functionality once implemented in the 
same page now apart, to two more pages, without invalidating already 
created and stored urls in the application, in search engines, etc.)

This limitation, however, could be easily overcomed would 
TUrlMappingPattern provide a way to use the result of $request-
>getRequestUri() instead of $request->getPathInfo(). Therefore I propose 
to add a new property to the latter class, which would enable developers 
to make use of that extra part of the url, too, in match-checks (againt 
the pathinfo+querystring part of the url), while also preserving backwards 
compatibility (matching against only the path info).

Original issue reported on code.google.com by google...@pcforum.hu on 20 Oct 2009 at 2:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I've implemented this feature in the attached file (source based on stock 3.1.6 
sources). TUrlMappingPattern (and thus the <url> tags in the mapping config) 
now 
have a new property named 'UrlMatchMode', which defaults to 'PathInfo', but if 
set 
to 'Full', it will match the Pattern property against the pathinfo+querystring, 
parts instead of just the pathinfo part itself of the request. It will also 
escape 
the "?" character for the regular expr. matching in the Pattern if there's one.

I've tested and need this only in EnableCustomUrl=false mode (eg. only to 
divert 
calls to pages based on the params, not construct any urls using those), so it 
will 
have to be tested with EnableCustomUrl=true yet, whether it works as expected.

Original comment by google...@pcforum.hu on 20 Oct 2009 at 3:03

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks.
Moved to 3.2a since we won't add any new feature to 3.1 branch

Original comment by Christophe.Boulain@gmail.com on 12 Jan 2010 at 11:19

GoogleCodeExporter commented 9 years ago

Original comment by ctrlal...@gmail.com on 25 Jun 2012 at 1:56

GoogleCodeExporter commented 9 years ago

Original comment by ctrlal...@gmail.com on 21 Jan 2013 at 7:03

GoogleCodeExporter commented 9 years ago

Original comment by ctrlal...@gmail.com on 24 Jul 2013 at 1:46

GoogleCodeExporter commented 9 years ago
Moved to github: https://github.com/pradosoft/prado/issues

Original comment by ctrlal...@gmail.com on 1 Oct 2013 at 10:14