DI router
The problem https://forum.phalconphp.com/discussion/7849/router-mount#C21343
di->set('router') has not autoloader class
https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/application.zep
Linha 210
let router =
Linha 280 moduleObject->registerAutoloaders(dependencyInjector);
To submit a bug you need to provide a single PHP file with all the necessary code to reproduce the issue.
/configs/services.php
$di->set('router', function () {
$router = new Router();
include __DIR__.'/../library/System/Routes/Loja.php';
include __DIR__.'/../library/System/Routes/Admin.php';
include __DIR__.'/../library/System/Routes/Frontend.php';
$router->mount(new \System\Routes\Frontend);
$router->mount(new \System\Routes\Loja);
$router->mount(new \System\Routes\Admin);
$router->notFound(array(
"controller" => "index",
"action" => "notfound"
));
return $router;
});
After running your test:
Notice: Undefined variable: di in /Users/phalcon/cphalcon/a.php on line 3
PHP Fatal error: Call to a member function set() on null in /Users/phalcon/cphalcon/a.php on line 3
This is a shortcode, and all another works here the full code All other di-set in the same file works problem is only in router.
index.php http://pastebin.com/2e35MpFJ
config.php ( same for all modules ) http://pastebin.com/qdxV3zcT
services.php http://pastebin.com/QRq6A5FZ
Module.php ( same for all modules ) http://pastebin.com/wD0gB3mv
Looks to me that router are not able to call class, can you make a test in your router calling any class from library!
services.php line 3 Phalcon\DI\FactoryDefault
should modified to Phalcon\DI\FactoryDefault as FactoryDefault
becase you create an instance by FactoryDefault, not Phalcon\DI\FactoryDefault in line 22
Is the same, because as is just to set an alias. and in others di->set all works fine,
$di->set dispatcher if you look i use 3 \System\ Class
I'm closing this issue due to the lack of any reaction. I'll open it again if the need arises and providing a minimal script to reproduce.