Hi,
I am getting into Phalcon with a multimodule project. I have a hard time with namespaces and modules interactions. I want to access a module model from another module, frontend module calls a cms module model. Here is how I declared the classes :
// CategoryModel in CmsModule
namespace Application\Cms\Models;
class Category extends \Phalcon\Mvc\Model
{ // ... }
// CategoryController in CmsModule
namespace Application\Cms\Controllers;
use Application\Cms\Models\Category as Category;
class CategoryController extends ControllerBase
{ // Here a new Category() or a Category::class work }
// FrontendController in Frontend module
namespace Application\Frontend\Controllers;
use Application\Cms\Models\Category as Category;
class IndexController extends ControllerBase
{ // Here a new Category() or a Category::class DO NOT work }
Both modules are declared in apps/config/modules.php and each module/Module.php declares their namespace with registerAutoloaders(DiInterface $di = null)
What am I doing wrong here ?
Thanks in advance for any help.