コード例 #1
0
 public function render()
 {
     // TODO Do not use global
     global $microblogTemplates, $pageTitle, $pageAuthor, $post;
     $postView = new PostView();
     $activitiesView = new ActivitiesView();
     $profileView = new ProfileView();
     $followView = new FollowView();
     $tpl = new \rubisco\text\SimpleTemplate($microblogTemplates);
     $tpl->pageAuthor = $pageAuthor;
     $tpl->pageTitle = $pageTitle;
     $tpl->showLog = '';
     $tpl->login = "******";
     $tpl->infoMessage = $this->m->getLastInfoMessagesAsHTML();
     $tpl->postView = '';
     $tpl->activities = $activitiesView->html();
     $tpl->profile = $profileView->html();
     $tpl->follow = $followView->html();
     if ($this->m->isLogin()) {
         $tpl->showLog = '<li><a href="?showLog=1">Show Log</a></li>';
         $tpl->login = "******";
         $tpl->postView = $postView->html($post['message'], $post['to']);
     }
     $this->m->clearLastInfoMessages();
     $content = $tpl->render('head') . $tpl->render('main') . $tpl->render('foot');
     header('Content-Type: text/html; charset=utf-8');
     header('Content-Length: ' . strlen($content));
     echo $content;
 }