mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 20:43:49 +00:00
Configure routes using annotation
This commit is contained in:
@@ -17,6 +17,7 @@ use Chill\CustomFieldsBundle\Form\CustomFieldType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* Class CustomFieldController.
|
||||
@@ -25,6 +26,7 @@ class CustomFieldController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* Creates a new CustomField entity.
|
||||
* @Route("/{_locale}/admin/customfield/new", name="customfield_new")
|
||||
*/
|
||||
public function createAction(Request $request)
|
||||
{
|
||||
@@ -54,6 +56,8 @@ class CustomFieldController extends AbstractController
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing CustomField entity.
|
||||
*
|
||||
* @Route("/{_locale}/admin/customfield/edit", name="customfield_edit")
|
||||
*/
|
||||
public function editAction(mixed $id)
|
||||
{
|
||||
@@ -75,6 +79,8 @@ class CustomFieldController extends AbstractController
|
||||
|
||||
/**
|
||||
* Displays a form to create a new CustomField entity.
|
||||
*
|
||||
* @Route("/{_locale}/admin/customfield/new", name="customfield_new")
|
||||
*/
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
@@ -103,27 +109,9 @@ class CustomFieldController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a CustomField entity.
|
||||
*
|
||||
* @deprecated is not used since there is no link to show action
|
||||
*/
|
||||
public function showAction(mixed $id)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$entity = $em->getRepository(CustomField::class)->find($id);
|
||||
|
||||
if (!$entity) {
|
||||
throw $this->createNotFoundException('Unable to find CustomField entity.');
|
||||
}
|
||||
|
||||
return $this->render('ChillCustomFieldsBundle:CustomField:show.html.twig', [
|
||||
'entity' => $entity, ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Edits an existing CustomField entity.
|
||||
* @Route("/{_locale}/admin/customfield/update", name="customfield_update")
|
||||
*/
|
||||
public function updateAction(Request $request, mixed $id)
|
||||
{
|
||||
|
Reference in New Issue
Block a user