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

Phalcon Boilerplate and Devtools

Hi, i try to use devtools with Phalcon Boilerplate. When use "phalcon model XXX" or "phalcon controller xxx " i get this error:

 Error: Builder doesn't know where is the models directory.  
 Error: Please specify a controller directory.  

Inside de index.php i have a instance of Loader set with models and controllers directory.

/*================== LOADER ===================*/

$loader = new \Phalcon\Loader();
$loader->registerNamespaces([
    'App' => APP_DIR . '/library/App'
]);
$loader->registerDirs([
    APP_DIR . '/views/',
    APP_DIR . '/controllers/',
    APP_DIR . '/models/',
]);
$loader->register();

The instance of Phalcon\Config receive an array per parameter. Like this :

return [

  'debug' => true,
  'hostName' => 'https://localhost/phalcon-rest-boilerplate',
  'clientHostName' => 'https://localhost/phalcon-rest-boilerplate',
  'database' => [
      'adapter'           => 'Mysql',
      'host'              => '127.0.0.1',
      'username'          => 'root',
      'password'          => '',
      'dbname'            => 'phalcon_rest'
  ]
  'cors' => [
      'allowedOrigins'    => ['*']
  ]
];

At what time I tell devtools to use the controller directory. Where it is specified that devtools has to use the configuration of "database"

Thanks

por que webtools me aparece en blanco

Devtools uses config / config.php to find the drivers and models directory. The boilerplate project uses two configuration files. The fastest solution is to create config / config.php and modify public / iindex.php. The optimal solution I do not know, it may be to modify the file where the config is searched. Still pending