I'm trying to implement phalcon multi module with namespace. normally its working. but models not loading from its location(/apps/models/). if I paste all of my models file into controller dir then its working. It should load from models dir. how could i solve this problem.
[Front Module]
$loader->registerNamespaces(
array(
'Multiple\Frontend\Controllers' => '../apps/frontend/controllers/',
'Multiple\Frontend\Models' => '../apps/frontend/models/',
));
[Blogs Model]
namespace Multiple\Frontend\Controllers;
use Phalcon\Mvc\Model;
class Blogs extends Model{}
i also try "namespace Multiple\Frontend\Models;" but not success. getting error like:
Fatal error: Uncaught Error: Class 'Multiple\Frontend\Controllers\News' not found in C:\xampp\htdocs\pm\apps\frontend\controllers\IndexController.php:38 Stack trace: #0 [internal function]:
i have my dispatcher like:
public function registerServices(DiInterface $di)
{
# Registering a dispatcher
$di->set('dispatcher', function () {
$dispatcher = new Dispatcher();
$dispatcher->setDefaultNamespace("Multiple\Frontend\Controllers");
return $dispatcher;
});
i think the error : "Error: Class 'Multiple\Frontend\Controllers\Blogs' not found" for this cause default namespace is frontend\controller. how to solve it? please