title: turn URL route into funciton arguments php mvc
body: <p>I'm writing a custom MVC framework for a PHP project and everything is great until it comes to getting arguments from the URL route. I'm stuck on passing parts of the URL route into a function argument dynamically. I already have a method which is just to implode the route and use the array for the function arguments but I would really like to know how to do it like in CodeIgnitor or CakePHP. </p>
  
  <p>Here's what i want to have done. The site url would be...</p>
  
  <pre><code>url: http://yoursite.com/profile/view/35/foo
  </code></pre>
  
  <p>and in my controller I would have...</p>
  
  <pre><code>&lt;?php
  
  Class profileController Extends baseController 
  {
  
      public function view($ID, $blah)
      {
          echo $ID; //would show 35
          echo $blah; //would show foo
      }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>I would really like to know how this is done. Thanks a lot! </p>