title: PHP OOP and AJAX: How to handle serverside in Class?
body: <p>I'm working on converting my standard PHP project to OOP but I ran into a wall about how to handle AJAX calls with PHP Classes. I'm not happy with the way I'm doing this now. I have a TillAjax.php file which I call from my TillUI.php file from a AJAX call.</p>
  
  <p>In the TillAjax.php file I do this to get the information passed from the ajax call.</p>
  
  <pre><code>$till = new Till();
  if(isset($_POST['data']))
      $till-&gt;doStuff($_POST['data']);
  </code></pre>
  
  <p>I think this ruins the OOP.</p>
  
  <p>I have worked with ASP.NET MVC and here its possible to call a specific action in a controller without i have to check for the post value. So I want to know if there is a smarter PHP way to solve the above problem?</p>