i have two modules called: Autenticacao and Utilizadores.
In my AutenticacaoController, i want to access to UserTable, which is inside the module Utilizadores:
any example of this?
Code AutenticacaoController:
private $usersTable;
public function __construct(UserTable $usersTable) {
$this->usersTable = $usersTable;
}
public function getusersAction(): JsonModel {
$this->usersTable->getAll(); //<- not working, because UserTable is not accessible
return new JsonModel();
}
You are going to need to create a factory for your controller.
There’s this guide.
You’re about here in that guide, the next step would be to create the factory and link it to the controller through configuration as outlined here.