IndexController.inc 603 B

1234567891011121314151617181920212223242526
  1. <?php
  2. class IndexController implements IController {
  3. private $view;
  4. private $form;
  5. private $headRenderer;
  6. private $postRenderer;
  7. public function __construct() {
  8. $this->view = new View();
  9. $this->form = new Form();
  10. $this->headRenderer = new HeadRenderer();
  11. $this->postRenderer = new PostRenderer();
  12. }
  13. public function execute() {
  14. $page = $this->form->getCleanDefaulted("c", 0);
  15. $viewData = array(
  16. "header" => $this->headRenderer->render(),
  17. "postsView" => $this->postRenderer->getPostsInUserTopics($page)
  18. );
  19. return $this->view->render("indexView.inc", $viewData);
  20. }
  21. }