Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What you're referring to with the URLs really has little to do with MVC. It is an implementation of REST architecture. ( <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer" rel="nofollow">Wiki Article</a> )</p> <p>Basically instead of using sessions, each URL should contain all of the information the server needs in order to create a request. </p> <p>There are a couple of ways of doing this: </p> <p>You can use Apache's mod_rewrite to rewrite a PATH to the proper GET parameters. For example say you have a user management module that is normally accessed with:</p> <pre><code>http://your.domain/users.php?request=edit&amp;id=&lt;some id&gt; </code></pre> <p>You could put in Apache: </p> <pre><code>RewriteRule ^users\/edit\/(\d+) /users.php?request=edit&amp;id=$1 </code></pre> <p>Which would then allow you to address the same request with:</p> <pre><code>http://your.domain/users/edit/&lt;some id&gt; </code></pre> <p>(this is assuming ID is a number)</p> <p>This is pretty easy to if all of the requests you expect to issue are pretty simple. If they are more dynamic then it gets harder to set it all up. The other drawback, if you were wanting to release your new framework, would be that it requires your user to have at least the ability to modify the Apache config through .htaccess files. That may not always be the case.</p> <p>The alternative is write logic in the code that can parse the URL. In this case you usually need a controlling script for your entire site. The URL would be something like:</p> <pre><code>http://your.domain/users.php/edit/&lt;some_id&gt; &lt;?php // get the part that appears after the script name $parts = explode("/", $_SERVER['PATH_INFO'] ); $request = $parts[1]; $id = $parts[2]; // do somethign with the $request and the $id ?&gt; </code></pre> <p>As you can see, my example is simplistic but with option 2, it's easier to put much more complex logic to do all sorts of things.</p> <p>Hope that helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload