Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class DemoController
- {
- public function showBlogPostAction(Location $location, $viewType, $layout = false, array $params = array())
- {
- // We need the author, whatever the view type is.
- $repository = $this->getRepository();
- $author = $repository->getUserService()->loadUser($location->getContentInfo()->ownerId);
- // TODO once the keyword service is available, load the number of keyword for each keyword
- // Delegate view rendering to the original ViewController
- // (makes it possible to continue using defined template rules)
- // We just add "author" to the list of variables exposed to the final template
- return $this->get('ez_content')->viewLocation(
- $location->id,
- $viewType,
- $layout,
- array('author' => $author) + $params
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement