Essence\Dom\Document::tags PHP Метод

tags() абстрактный публичный Метод

Returns all tags identified by the given name.
abstract public tags ( string $name, Closure $filter = null ) : array
$name string Tag name.
$filter Closure A callback to filter tags.
Результат array Tags.
    public abstract function tags($name, Closure $filter = null);

Usage Example

Пример #1
0
 /**
  *	Extracts URLs from tag attributes.
  *
  *	@param Document $Document Document.
  *	@param string $tag Tag name.
  *	@param string $attribute Attribute name.
  *	@return array URLs.
  */
 protected function _extractUrlsFromtags(Document $Document, $tag, $attribute)
 {
     $tags = $Document->tags($tag);
     return array_map(function ($Tag) use($attribute) {
         return $Tag->get($attribute);
     }, $tags);
 }