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

Can't generate table after updating developers tools

Hi! I've updated the Developer Tools to v3.

I'm trying to generate model with following code:

phalcon model --output=app/Common/Models/ --namespace="Common\Models" --extends="\Common\Models\ModelBase" --mapcolumn --name=TABLE_NAME

This works fine on DevTools v2, but now I have the following error:

Phalcon DevTools (3.0.0)

  Error: Database configuration cannot be loaded from your config file.

Any suggestion? Thanks for help.

Phalcon also updated to 3.0.x.

and if your config file is not in 'app/config.php' uses this argument:

--directory=app/default/

to make known where is the config.php.

Example:

phalcon model --name=locale_source --get-set --namespace=Druphal\\Language\\Models --output=../../modules/language/src/Models/ --directory=app/default/
edited Sep '16

and if your config file is not in 'app/config.php' uses this argument:

--directory=app/default/

to make known where is the config.php.

Example:

phalcon model --name=locale_source --get-set --namespace=Druphal\\Language\\Models --output=../../modules/language/src/Models/ --directory=app/default/

I've also updated the Phalcon to v3.0.0

Trying:

phalcon model --output=app/Common/Models/ --namespace="Common\Models" --extends="\Common\Models\ModelBase" --mapcolumn --name=TABLE_NAME --directory=/app/Common/Config/

The same error.

not used:

--directory=/app/Common/Config/

use:

--directory=/app/Common/

you structure is:

- app
    - Common
        - config   <- lowercase
            config.php

and config.php

<?php

defined('APP_PATH') || define('APP_PATH', realpath('../..'));

return new \Phalcon\Config([
    'database' => [
        'adapter' => 'Postgresql',
        'host' => 'localhost',
        'username' => 'xerron',
        'password' => 'root',
        'dbname' => 'db_uwu'
    ],

    // ...etc...
]);
    -