SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot CdeMky's Avatar
    Join Date
    Sep 2004
    Location
    United States
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Zend Framework "pretty" URL's

    I know some of you are already ZF experts, so I throw this out there to get your take on it.


    I have a form, and when I submit to a controller, using method="get",
    my URL's are in the form of

    /Controller?param1=val1 & param2=val2

    After a form submission how can I get them into the format

    /Controller/Action/Param1/val1/Param2/val2

    This isn't about functionality btw this is just about site consistancy, i don't really want zend url's one some pages, and standard request urls after form subissions.

    Any help is appreciated.

  2. #2
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why not use a header to redirect it right away, or, if JS is a requirement for your app, take the form, and instead of submitting it, just use location.href = '/Controller/Action/Param/FormValue'

    Regards,
    Eric
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  3. #3
    SitePoint Zealot CdeMky's Avatar
    Join Date
    Sep 2004
    Location
    United States
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eric.Coleman
    Why not use a header to redirect it right away, or, if JS is a requirement for your app, take the form, and instead of submitting it, just use location.href = '/Controller/Action/Param/FormValue'

    Regards,
    Eric
    So you're saying snag the request data, format the URL and then redirect?

  4. #4
    Ribbit... Eric.Coleman's Avatar
    Join Date
    Jun 2001
    Location
    In your basement
    Posts
    1,268
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically, yes, since your relying on that form data...
    Eric Coleman
    We're consentratin' on fallin' apart
    We were contenders, now throwin' the fight
    I just wanna believe, I just wanna believe in us

  5. #5
    SitePoint Zealot CdeMky's Avatar
    Join Date
    Sep 2004
    Location
    United States
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Eric.Coleman
    Basically, yes, since your relying on that form data...
    Ok, thanks for the response!

  6. #6
    SitePoint Member
    Join Date
    Jun 2006
    Location
    Zagreb, Croatia
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by CdeMky
    This isn't about functionality btw this is just about site consistancy, i don't really want zend url's one some pages, and standard request urls after form subissions.
    Don't change it, it's not up to you to change the way HTTP works. Your script isn't the one creating those URLs, your browser is the one doing that.

  7. #7
    SitePoint Addict jough's Avatar
    Join Date
    Sep 2001
    Location
    You have moved into a dark place. It is pitch blac
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is really a job for mod_rewrite. You should be able to find a lot of info about it in these fora.

    I believe the default rewriter for the ZF will map URLs to:

    domain.com/controller/action/var1/var1Value/var2/var2Value/ and so on.
    My Dynamic Site in Action:
    Poetry X Poetry Archive


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •