cse435website/lib/View.php
2017-10-25 12:43:25 -04:00

94 lines
1.7 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: sean
* Date: 5/26/17
* Time: 8:57 PM
*/
class View
{
public function __construct() {
$this->addNav("Home", "./");
$this->addNav("Progress", "./");
$this->addNav("Meet The Team", "./");
$this->addNav("Course Site", "https://cse.msu.edu/~cse435/");
}
public function head(){
$html = <<<HTML
<meta charset="utf-8">
<title>$this->title</title>
<link href="./style/default.css" rel="stylesheet" type="text/css">
HTML;
return $html;
}
public function header(){
$html = <<<HTML
<header>
<h1>$this->title</h1>
<nav><p class="nav-bar">|
HTML;
foreach($this->links as $link){
$name = $link['name'];
$to = $link['link'];
$html .= " <a href='$to'>$name</a> |";
}
$html .= <<<HTML
</p></nav>
</header>
HTML;
return $html;
}
public function page(){
$html = <<<HTML
<div class="card">
<h2>Roster:</h2>
<ul>
<li>Project Manager - James</li>
<li>Artifacts Manager - Sean</li>
<li>Project Facilitator- Stephen</li>
<li>Safety/Security Engineer - Logan</li>
<li>Domain Expert/Customer Liaison - Colin</li>
</ul>
</div>
HTML;
return $html;
}
public function addNav($name, $link){
$this->links[] = array("name" => $name, "link" => $link);
}
public function footer(){
$html = <<<HTML
<footer>
</footer>
HTML;
return $html;
}
public function setTitle($title){
$this->title = $title;
}
private $links = array();
private $title = "Not Set!";
}