Hi,
I've a working REST app with routing etc. Actually it responses
{"data":true}
Just fine so far. Now I like to add a plugin to the dispatch loop so I added it to the DI but nothing happens. Next I tested if it gets called at all, and unfortunatelly that's not the case.
TestCode:
/** Register default dependencies */
$dependencyInjector = new Phalcon\DI\FactoryDefault();
/** Register dispatcher */
$dependencyInjector->set(
'dispatcher', function () use ($dependencyInjector) {
die('hier');
);
$application = new Application($dependencyInjector);
echo $application->handle()->getContent();
If I run the code, the response is the same as above, like the dispatcher injection doesn't exist anyway. Some hints what I'm doing wrong?
Best, Thorsten