My index file looks as below;
error_reporting(E_ALL);
use Phalcon\Mvc\Router,
Phalcon\Mvc\Application,
Phalcon\DI\FactoryDefault;
$di = new FactoryDefault();
//Specify routes for modules
$di->set('router', function () {
$router = new Router();
$router->setDefaultModule("frontend");
$router->setDefaultNamespace('Project\Frontend\Controllers');
$router->add("/partner", array(
'module' => 'backend',
'controller' => 'index',
'action' => 'index',
));
return $router;
});
try {
//Create an application
$application = new Application($di);
// Register the installed modules
$application->registerModules(
array(
'frontend' => array(
'className' => 'Project\Frontend\FrontendModule',
'path' => '../apps/frontend/FrontendModule.php',
),
'backend' => array(
'className' => 'Project\backend\BackendModule',
'path' => '../apps/backend/BackendModule.php',
)
)
);
//Handle the request
echo $application->handle()->getContent();
} catch(\Exception $e){
echo $e->getMessage();
}