|
|||
|
I have an application which uses GET forms for the purpose of providing links which one person can send to another. For example:
Code:
projects.php?action=list&team=Design&client=SomeClientName&status=All Code:
/projects/list/?team=Design&client=SomeClientName&status=All HTML Code:
/projects/index/team/Design/client/SomeClientName/status/All Code:
/projects/index/Design/SomeClientName/All I wonder if a Controller Plugin can be written, to detect a GET request with variables, and perform the rewriting. Last edited by Davidoff : 10-23-2007 at 02:28 PM. |
|
|||
|
Indeed, the third url is what Zend Framework would process.
What I was trying to say is that if I submit a form, to /projects/list the URL will be Code:
/projects/list/?team=Design&client=SomeClientName&status=All |
|
||||
|
Code:
/projects/list/?team=Design&client=SomeClientName&status=All Code:
/projects/list/team/Design/client/SomeClientName/status/All 'team' => 'Design' 'client' => 'SomeClientName' 'status' => 'All' |
|
||||
|
Quote:
Code:
//gets one param with the key of 'foo'
$this->_request->getParam('foo');
//gets all params and returns an array
$this->_request->getParams();
|
|
|||
|
Perhaps I haven't explained the problem very well - if thats the case, my apologies.
When I submit a form, (and when anyone on any website in the universe submits a form), via the GET method, they are redirected to action?query_string Where action is the form action, and the query string is a product of the form fields. A ZF MVC application has pretty URLs. The URLs I generate to link from page to page are indeed 'pretty' URLs of the MVC format. The address of a page you're taken to after submitting a form ISNT. |
|
||||
|
I guess I don't follow, I write my urls as described above, whether they are for a GET form action, POST form action, anchor link, or whatever.
/module/controller/action/var1/val1/var2/val2/ the only exception for me is when I create custom routes. I haven't had a ? & or = in a url since I moved to rewrite capable frameworks. Generally I disable to default submit action of a form anyway and use AJAX to handle the form submit actions, but even in that case my urls all get written out the same way. I have on occasion put my variables in the request headers so they aren't displayed in the url at all, but I only do that for sensitive data. Since is doesn't prevent anyone from actually seeing, only adds an extra step or three, its just a way to not openly broadcast the information. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|