| @@ 4-23 (lines=20) @@ | ||
| 1 | <?php |
|
| 2 | namespace humanity; |
|
| 3 | ||
| 4 | class Description { |
|
| 5 | ||
| 6 | private static $memory = []; |
|
| 7 | ||
| 8 | public function add($title){ |
|
| 9 | if(!is_array($title)) $title = [$title]; |
|
| 10 | self::$memory = array_merge(self::$memory,$title); |
|
| 11 | return $this; |
|
| 12 | } |
|
| 13 | ||
| 14 | public function get(){ |
|
| 15 | self::$memory = array_reverse(self::$memory); |
|
| 16 | foreach(self::$memory as $key=>$value){ |
|
| 17 | $value = urldecode($value); |
|
| 18 | self::$memory[$key] = $value; |
|
| 19 | } |
|
| 20 | return '<meta name="description" content="'.implode(' ',self::$memory).'">'; |
|
| 21 | } |
|
| 22 | ||
| 23 | } |
|
| 24 | ?> |
|
| 25 | ||
| @@ 4-23 (lines=20) @@ | ||
| 1 | <?php |
|
| 2 | namespace humanity; |
|
| 3 | ||
| 4 | class Keywords { |
|
| 5 | ||
| 6 | private static $memory = []; |
|
| 7 | ||
| 8 | public function add($title){ |
|
| 9 | if(!is_array($title)) $title = [$title]; |
|
| 10 | self::$memory = array_merge(self::$memory,$title); |
|
| 11 | return $this; |
|
| 12 | } |
|
| 13 | ||
| 14 | public function get(){ |
|
| 15 | self::$memory = array_reverse(self::$memory); |
|
| 16 | foreach(self::$memory as $key=>$value){ |
|
| 17 | $value = urldecode($value); |
|
| 18 | self::$memory[$key] = $value; |
|
| 19 | } |
|
| 20 | return '<meta name="keywords" content="'.implode(',',self::$memory).'">'; |
|
| 21 | } |
|
| 22 | ||
| 23 | } |
|
| 24 | ?> |
|
| 25 | ||
| @@ 4-23 (lines=20) @@ | ||
| 1 | <?php |
|
| 2 | namespace humanity; |
|
| 3 | ||
| 4 | class Title { |
|
| 5 | ||
| 6 | private static $memory = []; |
|
| 7 | ||
| 8 | public function add($title){ |
|
| 9 | if(!is_array($title)) $title = [$title]; |
|
| 10 | self::$memory = array_merge(self::$memory,$title); |
|
| 11 | return $this; |
|
| 12 | } |
|
| 13 | ||
| 14 | public function get(){ |
|
| 15 | self::$memory = array_reverse(self::$memory); |
|
| 16 | foreach(self::$memory as $key=>$value){ |
|
| 17 | $value = urldecode($value); |
|
| 18 | self::$memory[$key] = $value; |
|
| 19 | } |
|
| 20 | return '<title>'.implode(' - ',self::$memory).'</title>'; |
|
| 21 | } |
|
| 22 | ||
| 23 | } |
|
| 24 | ?> |
|
| 25 | ||