Slim PHP - Right way to use request and response objects
<p>I'm new to Slim and PHP, but I'm trying to do a simple rest API with Slim. It's working, but I don't know if I'm doing it the right way and I cannot find another way to do it.</p>

<p>For example, I've a route like that:</p>

<pre><code>$app-&gt;get('/contacts', '\Namespace\Class:method');
</code></pre>

<p>The method:</p>

<pre><code>    public function searchContacts($request, $response) {

         return Contact::searchContacts($resquest, $response);
    }
</code></pre>

<p>So, the unique way I found to access request and response from other classes is by passing the objects as params. Is it correct or is there a better (right) way to do it?</p>