Hi All,
I'm trying to figure out how to make my Controllers more testable in my Micro application.
To that end, I figured I'd auto inject a related model into each controller.
I'm using this project as a starting point for my REST API. https://github.com/cmoore4/phalcon-rest
I read that you can do something like this in the Full Stack application. https://docs.phalcon.io/en/latest/reference/dispatching.html#inject-model-instances
Since Micro doesn't have $dispatcher, I looked into
$app = new \Phalcon\Mvc\Micro();
$app->before(function() user($app, $di) {
    $className = "MyModel";
    $modelName = "\\PhalconRest\\Models\\$className";
    $alt = new $modelName()
    //Model loaded, what now?  How to inject into controller?
}I can load a model but don't know how to perserve it for the controller to inject.
My app uses Collections to build routes.
My setup seems to require a string in setHandler so how to pass in a parameter?
Example: https://github.com/cmoore4/phalcon-rest/blob/develop/routes/collections/example.php
// VERSION NUMBER SHOULD BE FIRST URL PARAMETER, ALWAYS
// setHandler MUST be a string in order to support lazy loading
    $userCollection->setPrefix('/v1/user')
        ->setHandler('\PhalconRest\Controllers\MyController')
        ->setLazy(true);I'm open to ideas, help!