/system/library/document.php
PHP | 65 lines | 53 code | 12 blank | 0 comment | 0 complexity | 566ad53c764144b623e076b306d84e5a MD5 | raw file
- <?php
- final class Document {
- private $title;
- private $description;
- private $keywords;
- private $links = array();
- private $styles = array();
- private $scripts = array();
-
- public function setTitle($title) {
- $this->title = $title;
- }
-
- public function getTitle() {
- return $this->title;
- }
-
- public function setDescription($description) {
- $this->description = $description;
- }
-
- public function getDescription() {
- return $this->description;
- }
-
- public function setKeywords($keywords) {
- $this->keywords = $keywords;
- }
-
- public function getKeywords() {
- return $this->keywords;
- }
-
- public function addLink($href, $rel) {
- $this->links[md5($href)] = array(
- 'href' => $href,
- 'rel' => $rel
- );
- }
-
- public function getLinks() {
- return $this->links;
- }
-
- public function addStyle($href, $rel = 'stylesheet', $media = 'screen') {
- $this->styles[md5($href)] = array(
- 'href' => $href,
- 'rel' => $rel,
- 'media' => $media
- );
- }
-
- public function getStyles() {
- return $this->styles;
- }
-
- public function addScript($script) {
- $this->scripts[md5($script)] = $script;
- }
-
- public function getScripts() {
- return $this->scripts;
- }
- }
- ?>