itemListView('brands', [ 'name' => 'asc' ]); } #[Route('/new', name: 'brand_new', methods: ['GET', 'POST'])] public function new(Request $request): Response { return $this->itemCreate($request, 'brand'); } #[Route('/{id}', name: 'brand_show', methods: ['GET'])] public function show(Brand $brand): Response { return $this->itemView($brand, 'brand'); } #[Route('/{id}/edit', name: 'brand_edit', methods: ['GET', 'POST'])] public function edit(Request $request, Brand $brand): Response { return $this->itemUpdate($request, $brand, 'brand'); // // $form = $this->createForm(BrandType::class, $brand); // $form->handleRequest($request); // // if ($form->isSubmitted() && $form->isValid()) { // $entityManager->flush(); // // return $this->redirectToRoute('brand_index', [], Response::HTTP_SEE_OTHER); // } // // return $this->renderForm('brand/edit.html.twig', [ // 'brand' => $brand, // 'form' => $form, // ]); } #[Route('/{id}', name: 'brand_delete', methods: ['POST'])] public function delete(Request $request, Brand $brand): Response { return $this->deleteCSRF($request, $brand); } }