Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. class DemoController
  3. {
  4. public function showBlogPostAction(Location $location, $viewType, $layout = false, array $params = array())
  5. {
  6. // We need the author, whatever the view type is.
  7. $repository = $this->getRepository();
  8. $author = $repository->getUserService()->loadUser($location->getContentInfo()->ownerId);
  9. // TODO once the keyword service is available, load the number of keyword for each keyword
  10. // Delegate view rendering to the original ViewController
  11. // (makes it possible to continue using defined template rules)
  12. // We just add "author" to the list of variables exposed to the final template
  13. return $this->get('ez_content')->viewLocation(
  14. $location->id,
  15. $viewType,
  16. $layout,
  17. array('author' => $author) + $params
  18. );
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement