I created a custom controller for PUT item operation. I used the _invoke
method to make the default action but I tried to used a custom method to a second PUT action on the same item.
I tried this configurations without success.
* "activate"={
* "method"="PUT",
* "path"="/safety_rooms/{id}/activate",
* "requirements"={"id"="\d+"},
* "controller"=SafetyRoomPutItem::activeRoom,
* },
but I get [Semantical Error] Couldn't find constant App\Controller\SafetyRoomPutItem::activeRoom, class App\Entity\SafetyRoom.
I tried this configurations without success.
* "activate"={
* "method"="PUT",
* "path"="/safety_rooms/{id}/activate",
* "requirements"={"id"="\d+"},
* "controller"=SafetyRoomPutItem::class.activeRoom,
* },
but I get [Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_CURLY_BRACES, got '.' at position 1274 in class App\Entity\SafetyRoom.
I tried this configurations without success.
* "activate"={
* "method"="PUT",
* "path"="/safety_rooms/{id}/activate",
* "requirements"={"id"="\d+"},
* "controller"=SafetyRoomPutItem::class(activeRoom),
* },
I tried this configurations without success.
* "activate"={
* "method"="PUT",
* "path"="/safety_rooms/{id}/activate",
* "requirements"={"id"="\d+"},
* "controller"=SafetyRoomPutItem::class:activeRoom,
* },
I tried this configurations without success.
* "activate"={
* "method"="PUT",
* "path"="/safety_rooms/{id}/activate",
* "requirements"={"id"="\d+"},
* "controller"=SafetyRoomPutItem:activeRoom,
* },
I tried this configurations without success.
* "activate"={
* "method"="PUT",
* "path"="/safety_rooms/{id}/activate",
* "requirements"={"id"="\d+"},
* "controller"=[SafetyRoomPutItem::class, "activeRoom"],
* },
but I get [Syntax Error] Expected PlainValue, got '[' at position 1250 in class App\Entity\SafetyRoom.