Well , i do this manualy all the time
- Open Modules.php and add the module . Example Code :
$application->registerModules([
'Frontend' => [
'className' => 'Frontend\Module',
'path' => __DIR__ . '/../apps/Frontend/Module.php'
],
// new module
'Backend' => [
'className' => 'Backend\Module',
'path' => __DIR__ . '/../apps/Backend/Module.php'
],
]);
- in app folder duplicate the frontend folder and rename to
Backend
- in the backend folder edit the Module.php and rename th namespace to
Backend
. Example:
<?php
// here
namespace Backend;
use Phalcon\Loader,
Phalcon\Mvc\View,
Phalcon\Config\Adapter\Ini,
Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter,
Phalcon\Mvc\ModuleDefinitionInterface;
class Module
{
- also in the Module.php you will have to rename the registered namespaces. Example :
$loader->registerNamespaces([
'Backend\Controllers' => __DIR__ . '/controllers/',
'Backend\Models' => __DIR__ . '/models/'
]);
- now for the controllers / models you will have to rename all the namespaces. Example:
namespace Backend\Controllers;
namespace Backend\Models;