Sulu\Bundle\MarkupBundle\Tag\TagRegistryInterface::getTag PHP Method

getTag() public method

Returns tag by name.
public getTag ( string $name, string $type ) : Sulu\Bundle\MarkupBundle\Tag\TagInterface
$name string
$type string
return Sulu\Bundle\MarkupBundle\Tag\TagInterface
    public function getTag($name, $type);

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function validate($content, $locale)
 {
     $sortedTags = $this->getTags($content);
     if (0 === count($sortedTags)) {
         return [];
     }
     $result = [];
     foreach ($sortedTags as $name => $tags) {
         $result = array_merge($result, $this->tagRegistry->getTag($name, 'html')->validateAll($tags, $locale));
     }
     return $result;
 }
TagRegistryInterface