I want to work with multiple modules. Therefore I created via phalcon command frontend
and backend
modules. To use this command phalcon module frontend
I had to write a line in config.php
'modulesDir' => APP_PATH . '/app/modules/',
After use this command I started follow phalcon docs - according to this docs I had to register new modules by adding this code: (I put this in index.php
)
$application->registerModules(
array(
'frontend' => function ($di) use ($view) {
$di->setShared('view', function () use ($view) {
$view->setViewsDir('../apps/frontend/views/');
return $view;
});
},
'backend' => function ($di) use ($view) {
$di->setShared('view', function () use ($view) {
$view->setViewsDir('../apps/backend/views/');
return $view;
});
}
)
);
After done this acctions I updated routes
to default module - frontend
.
Finally after that I receive this notice:
IndexController handler class cannot be loaded
In index controller I putnamespace Application\Frontend\Controllers;
What should I fix or improve to it works correctly? Thanks in advance.