# First route "callable not found"

**URL:** <https://discourse.slimframework.com/t/first-route-callable-not-found/2147>\
**Category:** Questions\
**Created:** [January 8, 2018, 9:34am UTC](https://discourse.slimframework.com/t/first-route-callable-not-found/2147 "2018-01-08T09:34:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paradonym](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/paradonym/32/597_2.png) [@paradonym](https://discourse.slimframework.com/u/paradonym)\
**Post date:** [January 8, 2018, 9:34am UTC](https://discourse.slimframework.com/t/first-route-callable-not-found/2147/1 "2018-01-08T09:34:03Z")

</div>

I’m doing my first steps in Slim and PHP trying to improve an existing app with new features.

app/src/routes.php  
`$app->group('/admin', function () {`

_snip_

```
$this->get('/incident', 'IncidentController:main')->setName('admin-incident-main');
    $this->get('/incident/retrieve[/{page:[0-9]+}[/{query}]]', 'IncidentController:retrieve')->setName('admin-incident-retrieve');

```

app/Web/Controller/IncidentController.php

```
final class IncidentController
{
    const MAIL_RECIPIENT = 'something@domain.tld';

    private $view;
    private $client;

    public function __construct(PhpRenderer $view, Client $client)
    {
        $this->view = $view;
        $this->client = $client;
    }

    public function main(ServerRequestInterface $request, ResponseInterface $response)
    {
        return $this->view->render($response, 'incident/main.phtml');
    }
}

```

incident/main.phtml is a copy of another page which already works through different routes. I could use the other response simply using another .phtml, but I think this isn’t the error here

However if I’m trying to access `domain.tld/admin/incident`:

```
Type: RuntimeException
Message: Callable IncidentController does not exist
File: C:\Users\$USER\Documents\$PROJECTNAME\vendor\slim\slim\Slim\CallableResolver.php
Line: 62

```

So far I know the `$this->get('/incident', 'IncidentController:main [...]` in routes.php should call the main procedure in app/Web/Controller/IncidentController.php where the file should be according to the Slim Docs.  
This Controller should simply output /app/views/incident/main.phtml (which can be a “Hello world” text-output too in this stage) - but the Controller itself isn’t found.

Did I miss something? Does Slim need to get to know the Controller elsewhere and not only in routes.php?

---

<div class="post-metadata">

**Author:** ![paradonym](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/paradonym/32/597_2.png) [@paradonym](https://discourse.slimframework.com/u/paradonym)\
**Post date:** [January 8, 2018, 11:22am UTC](https://discourse.slimframework.com/t/first-route-callable-not-found/2147/2 "2018-01-08T11:22:23Z")

</div>

I set up a dependency in dependencies.php and now it works. I don’t quite know why that was required…
