PHP Blog - Creating Category error

PHP Blog - Creating Category error

dimitur.gaberov avatar dimitur.gaberov 0 Точки

PHP Blog - Creating Category error

Здравейте колеги

Когато се опитам да създам нова категория в блога ми дава грешка : (Controller "SoftUniBlogBundle\Controller\Admin\CategoryController::createCategory()" requires that you provide a value for the "$request" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.)

Това е функцията createCategory()   :

 

/**
 * @Route("/create", name="admin_categories_create")
 *
 * @param Request $request
 * @return \Symfony\Component\HttpFoundation\Response
 */
public function createCategory(Request $request)
{
    $category = new Category();

    $form = $this->createForm(CategoryType::class, $category);

    $form->handleRequest($request);

    if ($form->isSubmitted() && $form->isValid()) {
        $em = $this->getDoctrine()->getManager();
        $em->persist($category);
        $em->flush();

        return $this->redirectToRoute('admin_categories');
    }

    return $this->render('admin/category/create.html.twig',
        ['form' => $form->createView()]);
}

 

Ако някой има идея защо не работи, нека удари едно рамо :)