Hi everyone! I have a problem with loading "Model" classes from directory in phalcon framework 2.0.
I can't use namespaces now, because project is migrating step by step from ZF1, and Model classes has many dependencies with themselves. If I register namespaces for every directory - loader works great, but I need to do that without namespaces.
So I do that:
$loader = new \Phalcon\Loader(); $loader->registerDirs( [ /** Phalcon controllers */ $configPhalcon->application->controllersDir, /** Phalcon controllers */ /** Models */ $configPhalcon->application->servicesDir, ... ... ], true )->register();
Class name are Service_Name(), where Service - directory. File name are Name.php, so I need to register class prefixes for directories:
$loader->registerPrefixes( [ 'Service_' => $configPhalcon->application->servicesDir, ... ... ], true )->register();
Now, I want to get my service class:
$serv = new Service_Name();
and get Fatal error: Class 'Service_Name' not found. Help me please what I do wrong?