Closed GoogleCodeExporter closed 8 years ago
Some comments on the patch:
- it's probably based on a quite old version of prado; please consider rebasing your working copy on a more recent version;
- at TUrlMapping.php:702 the name of an array has changed ($matches2[$key]): it seems an error to me
- i didn't really find the patch that enables constant parameters in TUrlMapping
Original comment by ctrlal...@gmail.com
on 21 Jan 2013 at 7:01
Right. I've implemented that in a subclass, which also adds caching
functionality to the url mapping, which otherwise is always reparsed from the
.xml file (unless the PHP style configuration is used, in newer versions).
The new constant parameter feature can be used just like the original
"parameters" parameters, except that the supplied value will be treated as a
simple string constant instead of a regular expression. Eg:
<url ServiceParameter="MyPage" pattern="/mypage/mypath/list/detail/{pageidx}"
parameters.pageidx="\d+" constants.listtype="detailed"/>
<url ServiceParameter="MyPage" pattern="/mypage/mypath/list/summary/{pageidx}"
parameters.pageidx="\d+" constants.listtype="summarized"/>
after which when querying the request parameters, the application will see the
"lisstype" parameter present (even through not supplied in the request) and
equal to "detailed" or "summarized", depending on the friendly url used, which
practically will function as a table-based validation and translation of
specified, fixed-set parameter values.
Please consider the attached code donated.
Original comment by google...@pcforum.hu
on 21 Jan 2013 at 10:15
Attachments:
Thank you. I'm currently reviewing the code in order to add it to prado.
Original comment by ctrlal...@gmail.com
on 27 Jan 2013 at 10:57
Created ticket #437 for the merge of the donated code, thank you.
Original comment by ctrlal...@gmail.com
on 5 Feb 2013 at 11:37
Original issue reported on code.google.com by
google...@pcforum.hu
on 20 Jan 2013 at 3:24Attachments: