The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

How does slim interpret this URI?

osindiateam's Avatar

osindiateam

09 May, 2012 04:05 PM

I have a URI like this:

  /Categories/categoryid/Products/ProductID/ 
  /Categories/categoryid/Products/

The above tow work fine, Returns particular Product details and list of products respectively.
But in the first URI, if I give #### instead of product ID (/Categories/categoryid/Products/####/ , it still returns products list and considers the following URI by default ignoring ####

  /Categories/categoryid/Products/

Is this expected. I am using the latest version.

  1. 1 Posted by osindiateam on 10 May, 2012 03:46 PM

    osindiateam's Avatar

    Josh: Any idea on this?

  2. Support Staff 2 Posted by Josh Lockhart on 10 May, 2012 04:12 PM

    Josh Lockhart's Avatar

    I'll try to look at this tonight after work.

  3. 3 Posted by osindiateam on 10 May, 2012 04:14 PM

    osindiateam's Avatar

    Thanks a ton, Josh!

  4. Support Staff 4 Posted by Andrew Smith on 11 May, 2012 05:50 PM

    Andrew Smith's Avatar

    This should be the correct behaviour, since the browser interprets # as if it was empty, I am sure if you try this with another website you would get the same result.

    http://help.slimframework.com/discussions/questions/####/

    This will give you all the questions, same as just the url without the ####

  5. 5 Posted by osindiateam on 11 May, 2012 07:44 PM

    osindiateam's Avatar

    Also, /Something/%%%/ throws

      Bad request
      Your browser sent a request that this server could not understand.
    

    Should this be handled by Slim?

  6. Support Staff 6 Posted by Andrew Smith on 22 May, 2012 12:46 AM

    Andrew Smith's Avatar

    I will answer this the same as the previous, if you try this on any website the web server will catch it first and if it doesn't look like a normal request it will return an error before it even gets to Slim. e.g.

    http://help.slimframework.com/discussions/questions/%%%/

    Can you explain why you would need any of these symbols in the URL?

  7. Andrew Smith closed this discussion on 10 Jul, 2012 12:26 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac