Add doctrine and seperate out the renderer
This commit is contained in:
@ -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");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user