|
|
|
@ -3,15 +3,18 @@
|
|
|
|
|
namespace App\Controller;
|
|
|
|
|
|
|
|
|
|
use App\Connexion;
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
use App\Gateway\AuthGateway;
|
|
|
|
|
use App\Gateway\TacticInfoGateway;
|
|
|
|
|
use App\Http\HttpResponse;
|
|
|
|
|
use App\Http\ViewHttpResponse;
|
|
|
|
|
use App\Model\AuthModel;
|
|
|
|
|
use App\Model\TacticModel;
|
|
|
|
|
use App\Gateway\TeamGateway;
|
|
|
|
|
use App\Model\TeamModel;
|
|
|
|
|
use App\Session\SessionHandle;
|
|
|
|
|
use App\Controller\Sub\EditorController;
|
|
|
|
|
|
|
|
|
|
class UserController {
|
|
|
|
|
class UserController extends VisitorController {
|
|
|
|
|
private TacticModel $tacticMdl;
|
|
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
@ -20,18 +23,6 @@ class UserController {
|
|
|
|
|
$this->tacticMdl = new TacticModel(new TacticInfoGateway($con));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
=======
|
|
|
|
|
use App\Gateway\TacticInfoGateway;
|
|
|
|
|
use App\Gateway\TeamGateway;
|
|
|
|
|
use App\Http\HttpResponse;
|
|
|
|
|
use App\Http\ViewHttpResponse;
|
|
|
|
|
use App\Model\TacticModel;
|
|
|
|
|
use App\Model\TeamModel;
|
|
|
|
|
use App\Session\SessionHandle;
|
|
|
|
|
|
|
|
|
|
class UserController extends VisitorController {
|
|
|
|
|
|
|
|
|
|
>>>>>>> d54559e01d3d734d87c95607d2dfbc5a2a616695
|
|
|
|
|
public function home(): HttpResponse {
|
|
|
|
|
$listTactic = $this->tacticMdl->getLast(5);
|
|
|
|
|
return ViewHttpResponse::twig("home.twig", ["recentTactic" => $listTactic]);
|
|
|
|
@ -44,12 +35,12 @@ class UserController extends VisitorController {
|
|
|
|
|
|
|
|
|
|
public function edit(int $id, SessionHandle $session): HttpResponse {
|
|
|
|
|
$model = new TacticModel(new TacticInfoGateway(new Connexion(get_database())));
|
|
|
|
|
return (new Sub\EditorController($model))->edit($id, $session);
|
|
|
|
|
return (new EditorController($model))->edit($id, $session);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function create(SessionHandle $session): HttpResponse {
|
|
|
|
|
$model = new TacticModel(new TacticInfoGateway(new Connexion(get_database())));
|
|
|
|
|
return (new Sub\EditorController($model))->createNew($session);
|
|
|
|
|
return (new EditorController($model))->createNew($session);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function open(int $id, SessionHandle $session): HttpResponse {
|
|
|
|
|