Answer the question
In order to leave comments, you need to log in
Controller is not called?
Controller "Backend\ChatBundle\Controller\ChatController::indexAction" for URI "/chat/id1222" is not callable.
routing.yml:
backend_chat:
resource: "@BackendChatBundle/Controller/"
type: annotation
prefix: /chat
/**
* Class ChatController
* @package Backend\ChatBundle\Controller
*/
class ChatController extends BaseController
{
/**
* @Route("/id{id}", requirements={"id": "\d+"}, name="backend_chat_chat_index")
* @Security("user.id == room.getRecipient().getId() || user.id == room.getAuthor().getId()")
*/
public function indexAction(Room $room)
{
return $this->render('BackendChatBundle:Default:index.html.twig');
}
Answer the question
In order to leave comments, you need to log in
You are passing a numeric value to a function that expects a Room class as a parameter.
Change Room $room to $id.
public function indexAction($id)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question