Here is a pastebin to illustrate exactly whats going on. Look at the results of the ParameterHolder. It just literally parses the URL with no regard for the routing rules =/
http://hashphp.org/pastebin.php?pid=18667 Ian ----- Original Message ----- From: "Dustin Whittle" <[EMAIL PROTECTED]> To: <[email protected]>; "Ian" <[EMAIL PROTECTED]> Sent: Friday, June 01, 2007 7:42 PM Subject: Re: [symfony-devs] Accessing request params in myWebRequest > Can you attach the myWebRequest class or put it up on pastebin? Also, > maybe > a short snippet to reproduce? > > - Dustin > > On 6/1/07 6:18 PM, "Ian" <[EMAIL PROTECTED]> wrote: > >> >> So I have an issue with setting/getting request parameteters in >> myWebRequest (which is my default request factory). >> >> Assume I pass this url: >> >> http://subdomain.mydomain.com/client/list/atlanta/name/asc >> >> This route for this URL looks like the following: >> >> client_list: >> url: /clients/list/:city/:order/:dir/* >> param: { module: client, action: list, city: denver, order: name, >> dir: asc } >> >> >> In the myWebRequest class, if I try to print $this- >>> getParameter('city'), I get nothing. >> >> If I print_r($this->getParameterHolder()), I see something like this: >> >> sfParameterHolder Object ( [default_namespace:protected] => symfony/ >> default [parameters:protected] => Array ( [symfony/default] => Array >> ( [module] => clients [action] => list [atlanta] => name [asc] >> => ) ) ) >> >> It basically took the URL and parsed it out literally. If you notice, >> even the module says clients, instead of client. >> >> The proper request parameters ARE available in the action AND in the >> template. If I print_r($this->getRequest()->getParameterHolder()) in >> the action, it displays the proper request params. >> >> I'm not sure exactly where I'm going wrong here, or what is being >> manipulated in between, but I think it has something to do with the >> way that I am initializing myWebRequest. I have a __construct() >> method and am calling parent::initialize(sfContext::getInstance()); I >> also try to getParameter() inside the same construct() method, which >> is where I first noticed that it was not populating correctly. >> >> Is this the correct way to do this? I'm not sure why the parameter >> holder isnt storing the variables properly when I access them from >> myWebRequest, but they DO work by the time they get to the action and >> template. >> >> Thanks for the help :) >> >> >> >> > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en -~----------~----~----~----~------~----~------~--~---
