i just started a new project but cant get namespaces to work in phalcon i have never had this issue before if i remove the namespace its working fine.
Loader.php
<?php
$loader = new \Phalcon\Loader();
$loader->registerDirs(
[
$config->application->controllersDir,
$config->application->modelsDir
]
);
$loader->registerNamespaces(
[
'App\Controllers' => $config->application->controllersDir,
'App\Models' => $config->application->modelsDir,
]
)->register();
config.php
return new \Phalcon\Config([
'database' => [
'adapter' => 'Mysql',
'host' => 'localhost',
'username' => 'root',
'password' => 'root',
'dbname' => 'test',
'charset' => 'utf8',
],
'application' => [
'appDir' => APP_PATH . '/',
'controllersDir' => APP_PATH . '/Controllers/',
'modelsDir' => APP_PATH . '/Models/',
'migrationsDir' => APP_PATH . '/Migrations/',
'viewsDir' => APP_PATH . '/views/',
'cacheDir' => BASE_PATH . '/Cache/',
'baseUri' => '/',
]
]);
IndexController.php
<?php
declare(strict_types=1);
namespace App\Controllers;
class IndexController extends \Phalcon\Mvc\Controller
{
public function indexAction()
{
}
}