title: Accessing Slim framework in your own classes
body: <p>I'm using Slim Framework version 3.</p>
  
  <p>I've followed the <a href="http://www.slimframework.com/docs/tutorial/first-app.html" rel="nofollow">tutorial</a> on creating an app. Part of this involves setting up a <code>classes</code> directory where you can put your own PHP classes.</p>
  
  <p>What I can't understand is how you can access Slim inside those. For example if I have a class <code>src/classes/Users.php</code> and wanted to use the Slim Response code e.g. </p>
  
  <pre><code>return $response-&gt;withStatus(302)-&gt;withHeader('Location', 'login');
  </code></pre>
  
  <p>Obviously, <code>$response</code>, is not accessible at that point. It only seems to be in <code>index.php</code> where each callback recieves it as an argument.</p>
  
  <p>Do I have to pass something to every constructor of my own classes, or <code>use</code> or <code>require</code> statements in my classes?</p>