fix: add missing template variable
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controller\Administrative\Assignment;
|
namespace App\Controller\Administrative\Assignment;
|
||||||
|
|
||||||
|
use App\Controller\Traits\ReturnUrlTrait;
|
||||||
use App\Entity\Assignment;
|
use App\Entity\Assignment;
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
use App\Form\AssignmentType;
|
use App\Form\AssignmentType;
|
||||||
@@ -15,6 +16,8 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
|||||||
|
|
||||||
class CreateController extends AbstractController
|
class CreateController extends AbstractController
|
||||||
{
|
{
|
||||||
|
use ReturnUrlTrait;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
private readonly LoggerInterface $logger
|
private readonly LoggerInterface $logger
|
||||||
@@ -29,6 +32,7 @@ class CreateController extends AbstractController
|
|||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
$assignment = new Assignment();
|
$assignment = new Assignment();
|
||||||
$assignment->setOwner($user);
|
$assignment->setOwner($user);
|
||||||
|
$returnUrl = $this->getReturnUrl($request, 'app_administrative_assignment_index');
|
||||||
|
|
||||||
$form = $this->createForm(
|
$form = $this->createForm(
|
||||||
AssignmentType::class,
|
AssignmentType::class,
|
||||||
@@ -51,11 +55,12 @@ class CreateController extends AbstractController
|
|||||||
'job_profile' => $assignment->getJobProfile()->getName(),
|
'job_profile' => $assignment->getJobProfile()->getName(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $this->redirectToRoute('app_administrative_assignment_index');
|
return $this->redirectToRoute($returnUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('administrative/assignment/create.html.twig', [
|
return $this->render('administrative/assignment/create.html.twig', [
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
|
'returnUrl' => $returnUrl,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user