2
votes

So I installed Phalcon and the phalcon devtools. When I try anything, it throws an error (Generate model, generate controller and scaffolding). Looked around and I can see other people had this problem but I cannot find a solution.

Generate Model page:

Phalcon webtools generate model

Error on generate:

Phalcon webtools error

webtools.config.php:

define('PTOOLS_IP', '192.168.0.81');
define('PTOOLSPATH', 'C:/phalcon-tools/vendor/phalcon/devtools');

Error on generate controller:

Please specify a controller directory

Error on generate model:

Database configuration cannot be loaded from your config file

Error on scaffolding:

Adapter was not found in the config. Please specify a config variable [database][adapter]

1

1 Answers

1
votes

Had this same issue the other day. I found a work around but it's far from ideal.

Find

\devtools\scripts\Phalcon\Builder\

And open Components.php

Inside this file find the line:

foreach (array('/app/config/', 'config/') as $configPath) {

This line needs to be either:

(array('/../app/config/'  <- For model Generator to work.

or

(array('../app/config/' <- For scaffolding Generator to work.

I can't for the life of me work why, and it's far from ideal trying to remember to do it every time you need to use the tools, but it works.