Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service 'Module' wasn't found in the dependency injection container - windows 7 - 64bit #597

Closed
joeltejdeep opened this issue Feb 4, 2016 · 1 comment

Comments

@joeltejdeep
Copy link

joeltejdeep commented Feb 4, 2016

In my Windows 7, I'm facing the issue, after adding a new module from devtool.
Phalcon version 2.0.9 (latest). please help.

Steps I done:

  • I created project name as "test_project", type=module using devtool
  • Then I created a new module called "Admin", using devtool
  • I created IndexController and view in the Admin module
  • When I tried to run admin module, I'm getting the error
Service 'Test_project\Admin\Module' wasn't found in the dependency injection container
#0 [internal function]: Phalcon\Di->get('Test_project\\Admin\\...')
#1 D:\wamp\www\test_project\public\index.php(36): Phalcon\Mvc\Application->handle()
#2 {main}
@sergeyklay
Copy link
Contributor

sergeyklay commented May 15, 2016

@joeltejdeep Did you register Admin module?

    $application = new \Phalcon\Mvc\Application($di);

    $application->registerModules([
        'admin', [
            'className' => 'Test_project\Admin\Module',
            'path'      => $config->application->modulesDir . 'Admin\Module.php',
        ]
    ]);

    echo $application->handle()->getContent();

Could you please provide a small script to reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants