...
Code Block | ||||
---|---|---|---|---|
| ||||
namespace My\Bundle\RestBundle\Rest\Controller; use eZ\Publish\Core\REST\Server\Controller as BaseController; class DefaultController extends BaseController { public function sayHello( $name ) { // @todo Implement me } } |
...
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 item or a Location, the visitor will be re-used.
...