1

I made a project with modules type with this command

phalcon project simkontrolprogja --type=modules

When i am adding new module in my project called administrator by use this command

phalcon module administrator

i have add the module on config/loader.php in config/loader.php

$loader->registerClasses([
    'Simkontrolprogja\Modules\Frontend\Module' => APP_PATH . '/modules/frontend/Module.php',
    'Simkontrolprogja\Modules\Administrator\Module' => APP_PATH . '/modules/administrator/Module.php',
    'Simkontrolprogja\Modules\Cli\Module'      => APP_PATH . '/modules/cli/Module.php'
]);

On bootsrap_web.php

enter image description here

$application->registerModules([
        'frontend' => ['className' => 'Simkontrolprogja\Modules\Frontend\Module'],
        'admin' => ['className' => 'Simkontrolprogja\Modules\Administrator\Module'],
    ]);

On Module.php

enter image description here

/**
     * Registers an autoloader related to the module
     *
     * @param DiInterface $di
     */
    public function registerAutoloaders(DiInterface $di = null)
    {
        $loader = new Loader();

        $loader->registerNamespaces([
            'Simkontrolprogja\Administrator\Controllers' => __DIR__ . '/controllers/',
            'Simkontrolprogja\Administrator\Models'      => __DIR__ . '/models/'
        ]);

        $loader->register();
    }

and when i try to access the module, this is happen enter image description here

IndexController.php

enter image description here

namespace Simkontrolprogja\Modules\Administrator\Controllers;
class IndexController extends ControllerBase
{

    public function indexAction()
    {

    }

}

Hope some body help me to solve this problem.

Maulana Yusuf
  • 337
  • 2
  • 4
  • 16

1 Answers1

0

Are you using a case sensitive file system?

Try capitalising the path to your namespace.

baychae
  • 86
  • 11