We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Enable webtools in a mvc multiple project

Hello,

I create a mvc multiple project using CLI dev-tools, Phalcon project XPTO --type=modules --trace. Then in the XPTO folder (project root) a run: phalcon webtools enable --directory=/var/www/git/XPTO

When i run web tools i have the following trace:

Phalcon\DI\Exception: Service 'config' cannot be resolved

0 [internal function]: Phalcon\DI\Service->resolve(NULL, Object(Phalcon\DI\FactoryDefault))

1 [internal function]: Phalcon\DI->get('config', NULL)

2 /home/user/phalcon-devtools/scripts/Phalcon/Web/Tools.php(140): Phalcon\DI->getShared('config')

3 /home/user/phalcon-devtools/scripts/Phalcon/Web/Tools/controllers/ControllersController.php(79): Phalcon\Web\Tools::getConfig()

4 [internal function]: ControllersController->listAction()

5 [internal function]: Phalcon\Dispatcher->dispatch()

6 /home/user/phalcon-devtools/scripts/Phalcon/Web/Tools.php(294): Phalcon\Mvc\Application->handle()

7 /var/www/git/XPTO/public/webtools.php(24): Phalcon\Web\Tools::main('/home/user...')

8 {main}

what is wrong ?



98.9k

It seems it's expecting has the 'config' as a service, could you add:

$di->set('config', $config);

To your services.php



11.5k

still not working... :(