poc form SDK (css)

This commit is contained in:
Benjamin Dalsass
2023-09-06 16:50:11 +02:00
parent d63b3d7265
commit 6f513a0402
5 changed files with 29 additions and 10 deletions

View File

@@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Stopwatch\Stopwatch;
/**
* Object controller.
@@ -77,7 +78,7 @@ class ObjectController extends AbstractController
*
* @Route("/{class<\w+>}/{id<\d+>}/edit", name="object_edit")
*/
public function objectEdit(Request $request, string $class, int $id, ObjectService $oObjectService) : Response
public function objectEdit(Request $request, string $class, int $id, ObjectService $oObjectService, Stopwatch $oStopWatch) : Response
{
// retrieve object
try{
@@ -88,9 +89,11 @@ class ObjectController extends AbstractController
}
// create object form
$oStopWatch->start('creating form');
$oForm = $this->createForm(ObjectType::class, $oObject, [
'object_class' => $class
]);
$oStopWatch->stop('creating form');
// handle HTTP request
$oForm->handleRequest($request);