I believe you can just $sf_request->getUri() in a template or $this-
>getRequest()->getUri() in an action to get the current url.

Thanks,
Michael

On Jan 31, 4:29 pm, "Donald Ball" <[EMAIL PROTECTED]> wrote:
> Hi folks, I'm continuing to learn the symfony framework and have a
> simple form question. A common pattern I've used in the past is to
> have URLs which respond to GET requests with forms and POST requests
> with actions that handle those form submissions. For instance:
>
> GET /bookmark - gets a form to create new bookmark
> GET /bookmark/23 - gets a form to edit bookmark 23
> POST /bookmark - creates a new bookmark
> POST /bookmark/23 - updates bookmark 23
>
> Naturally, I want the two GET requests to share the same template,
> though I'd prefer they have different actions. The question I have now
> is how to create a form tag which POSTs to the requesting URL without
> having to explicitly pass that information from the controller to the
> view. Said another way, is there a way that a view template can
> generate a form to POST to the requesting URL without any
> participation by the controller?
>
> I might have though that calling form_tag() without arguments would
> generate a form which POSTs to the requesting URL, but instead, it
> simply appends //index to the root path of the application and uses
> that as the action attribute value. I could manually create a form
> element and set its action attribute value to the
> request->getPathInfo() string, assuming I can find a way to access the
> request object in the view, but that strikes me as unsymfonious.
>
> Any suggestions?
>
> - donald
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to