PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/system/library/document.php

https://bitbucket.org/monobasic/shop.volero.ch
PHP | 65 lines | 53 code | 12 blank | 0 comment | 0 complexity | 566ad53c764144b623e076b306d84e5a MD5 | raw file
  1. <?php
  2. final class Document {
  3. private $title;
  4. private $description;
  5. private $keywords;
  6. private $links = array();
  7. private $styles = array();
  8. private $scripts = array();
  9. public function setTitle($title) {
  10. $this->title = $title;
  11. }
  12. public function getTitle() {
  13. return $this->title;
  14. }
  15. public function setDescription($description) {
  16. $this->description = $description;
  17. }
  18. public function getDescription() {
  19. return $this->description;
  20. }
  21. public function setKeywords($keywords) {
  22. $this->keywords = $keywords;
  23. }
  24. public function getKeywords() {
  25. return $this->keywords;
  26. }
  27. public function addLink($href, $rel) {
  28. $this->links[md5($href)] = array(
  29. 'href' => $href,
  30. 'rel' => $rel
  31. );
  32. }
  33. public function getLinks() {
  34. return $this->links;
  35. }
  36. public function addStyle($href, $rel = 'stylesheet', $media = 'screen') {
  37. $this->styles[md5($href)] = array(
  38. 'href' => $href,
  39. 'rel' => $rel,
  40. 'media' => $media
  41. );
  42. }
  43. public function getStyles() {
  44. return $this->styles;
  45. }
  46. public function addScript($script) {
  47. $this->scripts[md5($script)] = $script;
  48. }
  49. public function getScripts() {
  50. return $this->scripts;
  51. }
  52. }
  53. ?>