Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   eZ Publish 4.x / legacy

 
eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added note about EZP-23016.

...

Code Block
titleMy/Bundle/RestBundle/Resources/config/routing_rest.yml
myRestBundle_hello_world:
    pattern: /my_rest_bundle/hello/{name}
    defaults:
        _controller: myRestBundle.controller.default:sayHello
    methods: [GET]
Warning

Due to

JIRA
servereZ Systems JIRA tracker
columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
serverId841cf523-cc54-30bc-bc5d-89e63192498a
keyEZP-23016
, custom REST routes must be prefixed with ezpublish_rest_, or they won't be detected correctly.

Controller action

Unlike standard Symfony 2 controllers, the REST ones don't return an HttpFoundation\Response object, but a ValueObject. This object will during the kernel run be converted, using a ValueObjectVisitor, to a proper Symfony 2 response. One benefit is that when multiple controllers return the same object, such as a Content or a Location, the visitor will be re-used.

...