The assets directory should store any pictures that the site uses. Removed lingering directory
85 lines
1.4 KiB
PHP
85 lines
1.4 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", "./about.php");
|
|
$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
|
|
<p>Content coming soon...</p>
|
|
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!";
|
|
|
|
}
|