public function execute() { $action = DashboardAction::newFromContext($this->getContext()); $action->doAction(); $this->setAction($action); $this->content = $this->initContent(); }
<?php require_once "actions/DashboardAction.php"; require_once "classes/TimeStamp.php"; $action = new DashboardAction(); $action->execute(); require_once "header.php"; ?> <h3>Welcome, <?php echo $action->getUser()->firstName; ?> </h3> <?php foreach ($action->news as $news) { $timeStamp = new TimeStamp($news->postedOn); ?> <div class="container news-panel"> <div class="row"> <div class="col-sm-8"> <?php echo htmlentities($news->title); ?> </div> </div> <div class="row"> <div class="col-sm-8"> <?php echo htmlentities($news->content); ?> <br />