diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-03-20 14:37:49 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-03-20 14:37:49 +0100 |
commit | 552dd49b00cedb168c95cdf841971e93b0ad678d (patch) | |
tree | 350b824cba024ad65eb186110d36b9dc275f2f59 /class/class.art.php | |
parent | 1654358ea4e4c0a100d7e58b1001ece1f908b7b3 (diff) | |
download | wcms-552dd49b00cedb168c95cdf841971e93b0ad678d.tar.gz wcms-552dd49b00cedb168c95cdf841971e93b0ad678d.zip |
get tag
Diffstat (limited to 'class/class.art.php')
-rw-r--r-- | class/class.art.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/class/class.art.php b/class/class.art.php index cc7a0d0..897cd0b 100644 --- a/class/class.art.php +++ b/class/class.art.php @@ -44,7 +44,7 @@ class Art } } - public function default() + public function reset() { $now = new DateTimeImmutable(null, timezone_open("Europe/Paris")); @@ -83,9 +83,14 @@ class Art return $this->intro; } - public function tag() + public function tag($option) { - return $this->tag; + if ($option == 'string') { + $tag = implode(", ", $this->tag); + } elseif ($option == 'array') { + $tag = $this->tag; + } + return $tag; } public function datecreation($option) @@ -178,7 +183,9 @@ class Art public function settag($tag) { if (strlen($tag) < self::$len and is_string($tag)) { - $this->tag = strip_tags(trim(strtolower($tag))); + $tag = strip_tags(trim(strtolower($tag))); + $taglist = explode(", ", $tag); + $this->tag = $taglist; } } |