Skip to content

Instantly share code, notes, and snippets.

@pedroresende
Created June 12, 2015 10:03
Show Gist options
  • Save pedroresende/ce57dd78f74aa8f0a3d5 to your computer and use it in GitHub Desktop.
Save pedroresende/ce57dd78f74aa8f0a3d5 to your computer and use it in GitHub Desktop.
Controller "ez_content:viewLocation" for URI "/" is not callable.
parameters:
custom.view_controller.class: Cleverti\OverrideViewControllerBundle\Controller\ViewController
services:
custom.view_controller:
class: %custom.view_controller.class%
ez_content:
alias: custom.view_controller
<?php
namespace Cleverti\OverrideViewControllerBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use eZ\Bundle\EzPublishCoreBundle\Controller;
/**
* Description of ViewController
*
* @author Pedro Resende <pedroresende@ez.no>
*/
class ViewController extends Controller
{
public function viewLocationAction( $locationId, $viewType, $layout = false, array $params = array() )
{
$response = $this->get('ez_content')->viewLocation($locationId, $viewType, $layout, $params);
$response->setContent($response->getContent());
$response->setETag(md5($response->getContent()));
$response->setPrivate();
return $response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment