Hello,
In my form submission controller, I have :
return $this->redirectToRoute('TaskCreated', array('task' => $task,));
The routing works well through ::
TaskCreated:
path: /TaskCreated
defaults: { _controller: AppBundle:TaskCreated:taskCreated }
In my TaskCreated controller, I try to retrieve the fields value to transfer them to a dedicated template :
<?php
// src/AppBundle/Controller/TaskClassController.php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class TaskCreatedController extends Controller
{
public function taskCreatedAction($task)
{
return $this->render('taskCreated.html.twig', array('task' => $task,));
}
}
But symfony says that “Controller “AppBundle\Controller\TaskCreatedController::taskCreatedAction()” requires that you provide a value for the “$task” argument (because there is no default value or because there is a non optional argument after this one).” I guess it means that $task is empty when calling taskCreatedAction()…
So how can I retrieve my field values ?
Best regards,
MC