Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

Image.php

Same filename in this branch
  1. 11.1.x vendor/symfony/validator/Constraints/Image.php
  2. 11.1.x core/lib/Drupal/Core/Image/Image.php
  3. 11.1.x core/lib/Drupal/Component/Utility/Image.php
  4. 11.1.x core/modules/media/src/Plugin/media/Source/Image.php
  5. 11.1.x core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Image.php

Namespace

Symfony\Component\DomCrawler

File

vendor/symfony/dom-crawler/Image.php

View source
<?php


/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Symfony\Component\DomCrawler;


/**
 * Image represents an HTML image (an HTML img tag).
 */
class Image extends AbstractUriElement {
    public function __construct(\DOMElement $node, ?string $currentUri = null) {
        parent::__construct($node, $currentUri, 'GET');
    }
    protected function getRawUri() : string {
        return $this->node
            ->getAttribute('src');
    }
    protected function setNode(\DOMElement $node) : void {
        if ('img' !== $node->nodeName) {
            throw new \LogicException(\sprintf('Unable to visualize a "%s" tag.', $node->nodeName));
        }
        $this->node = $node;
    }

}

Classes

Title Deprecated Summary
Image Image represents an HTML image (an HTML img tag).
RSS feed
Powered by Drupal