Created
June 12, 2015 10:03
-
-
Save pedroresende/ce57dd78f74aa8f0a3d5 to your computer and use it in GitHub Desktop.
Controller "ez_content:viewLocation" for URI "/" is not callable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
custom.view_controller.class: Cleverti\OverrideViewControllerBundle\Controller\ViewController | |
services: | |
custom.view_controller: | |
class: %custom.view_controller.class% | |
ez_content: | |
alias: custom.view_controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Cleverti\OverrideViewControllerBundle\Controller; | |
use Symfony\Component\HttpFoundation\Response; | |
use eZ\Bundle\EzPublishCoreBundle\Controller; | |
/** | |
* Description of ViewController | |
* | |
* @author Pedro Resende <[email protected]> | |
*/ | |
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