Add doctrine and seperate out the renderer

This commit is contained in:
Tim
2023-08-16 14:28:06 +02:00
parent 56e8caa26c
commit 59200be680
11 changed files with 2158 additions and 54 deletions

View File

@ -2,6 +2,7 @@
namespace App\Controller;
use App\Entity\Book;
use App\View\RouteView;
use Ardent\Undercurrent\Attribute\Route;
use Ardent\Undercurrent\Http\GenericResponse;
@ -10,6 +11,7 @@ use Ardent\Undercurrent\Http\RouterConfig;
use Ardent\Undercurrent\Http\StatusEnum;
use Ardent\Undercurrent\View\BaseView;
use Ardent\Undercurrent\View\ViewInterface;
use Doctrine\ORM\EntityManager;
class HelloWorldController
{
@ -48,4 +50,13 @@ class HelloWorldController
{
return new GenericResponse("Hello $name!");
}
#[Route('/db')]
public function db(EntityManager $em): ResponseInterface
{
$repo = $em->getRepository(Book::class);
dump($repo->findAll());
return new GenericResponse("DB stuff");
}
}