diff --git a/Model/Html/Meta.php b/Model/Html/Meta.php index 10ec2d500..f9a06bfcd 100644 --- a/Model/Html/Meta.php +++ b/Model/Html/Meta.php @@ -60,6 +60,30 @@ class Meta implements RenderableInterface */ private $description = ''; + /** + * Itemprop. + * + * @var array + * @since 1.0.0 + */ + private $itemprops = []; + + /** + * Property. + * + * @var array + * @since 1.0.0 + */ + private $properties = []; + + /** + * Name. + * + * @var array + * @since 1.0.0 + */ + private $names = []; + /** * Add keyword. * @@ -166,6 +190,51 @@ class Meta implements RenderableInterface $this->description = $description; } + /** + * Set property. + * + * @param string $property Property + * @param string $content Content + * + * @return void + * + * @since 1.0.0 + */ + public function setProperty(string $property, string $content) : void + { + $this->properties[$property] = $content; + } + + /** + * Set itemprop. + * + * @param string $itemprop Property + * @param string $content Content + * + * @return void + * + * @since 1.0.0 + */ + public function setItemprop(string $itemprop, string $content) : void + { + $this->itemprops[$itemprop] = $content; + } + + /** + * Set name. + * + * @param string $name Property + * @param string $content Content + * + * @return void + * + * @since 1.0.0 + */ + public function setName(string $name, string $content) : void + { + $this->names[$name] = $content; + } + /** * {@inheritdoc} */ @@ -175,6 +244,60 @@ class Meta implements RenderableInterface . (!empty($this->author) ? '' : '') . (!empty($this->description) ? '' : '') . (!empty($this->charset) ? '' : '') - . ''; + . '' + . $this->renderProperty() + . $this->renderItemprop() + . $this->renderName(); + } + + /** + * Render property meta tags. + * + * @return string + * + * @since 1.0.0 + */ + private function renderProperty() : string + { + $properties = ''; + foreach ($this->properties as $key => $content) { + $properties .= ''; + } + + return $properties; + } + + /** + * Render itemprop meta tags. + * + * @return string + * + * @since 1.0.0 + */ + private function renderItemprop() : string + { + $itemprops = ''; + foreach ($this->itemprops as $key => $content) { + $itemprops .= ''; + } + + return $itemprops; + } + + /** + * Render name meta tags. + * + * @return string + * + * @since 1.0.0 + */ + private function renderName() : string + { + $names = ''; + foreach ($this->names as $key => $content) { + $names .= ''; + } + + return $names; } }