예제 #1
0
파일: main.php 프로젝트: rutgerkok/rCMS
 public function writeText(StreamInterface $stream, Website $website, $id, $data)
 {
     $title = htmlSpecialChars($data["title"]);
     $amount = (int) $data["amount"];
     $commentLookup = new CommentRepository($website->getDatabase());
     $latestComments = $commentLookup->getCommentsLatest($amount);
     $view = new CommentsSmallTemplate($website->getText(), $latestComments);
     $stream->write('<h2>' . $title . "</h2>\n");
     $view->writeText($stream);
 }
예제 #2
0
 public function init(Website $website, Request $request)
 {
     $oComments = new CommentRepository($website->getDatabase());
     $this->comments = $oComments->getCommentsLatest();
     $this->viewingUser = $website->getAuth()->getCurrentUser();
 }