public function render(FileInterface $file, $width, $height, array $options = [], $usedPathsRelativeToCurrentScript = false): string
    {
        if (!array_key_exists(self::OPTIONS_IMAGE_RELATVE_WIDTH_KEY, $options)
            && isset($GLOBALS['TSFE']->register[self::REGISTER_IMAGE_RELATVE_WIDTH_KEY])
        ) {
            $options[self::OPTIONS_IMAGE_RELATVE_WIDTH_KEY] = (float)$GLOBALS['TSFE']->register[self::REGISTER_IMAGE_RELATVE_WIDTH_KEY];
        }

        $view = $this->initializeView();
        $view->assignMultiple([
            'isAnimatedGif' => $this->isAnimatedGif($file),
            'config' => $this->getConfig(),
            'data' => $GLOBALS['TSFE']->cObj->data,
            'file' => $file,
            'options' => $options,
        ]);

        return $view->render('pictureTag');
    }
public function render(FileInterface $file, $width, $height, array $options = [], $usedPathsRelativeToCurrentScript = false): string
    {
        if (!array_key_exists(self::OPTIONS_IMAGE_RELATVE_WIDTH_KEY, $options)
            && isset($GLOBALS['TSFE']->register[self::REGISTER_IMAGE_RELATVE_WIDTH_KEY])
        ) {
            $options[self::OPTIONS_IMAGE_RELATVE_WIDTH_KEY] = (float)$GLOBALS['TSFE']->register[self::REGISTER_IMAGE_RELATVE_WIDTH_KEY];
        }

        $view = $this->initializeView();
        $view->assignMultiple([
            'isAnimatedGif' => $this->isAnimatedGif($file),
            'config' => $this->getConfig(),
            'data' => $GLOBALS['TSFE']->cObj->data,
            'file' => $file,
            'options' => $options,
        ]);

        return $view->render('pictureTag');
    }
public function render ( FileInterface $ file , $ width , $ height , array $ options = [ ] , $ usedPathsRelativeToCurrentScript = false ) : string { if ( ! array_key_exists ( self :: OPTIONS_IMAGE_RELATVE_WIDTH_KEY , $ options ) && isset ( $ GLOBALS [ 'TSFE' ] -> register [ self :: REGISTER_IMAGE_RELATVE_WIDTH_KEY ] ) ) { $ options [ self :: OPTIONS_IMAGE_RELATVE_WIDTH_KEY ] = ( float ) $ GLOBALS [ 'TSFE' ] -> register [ self :: REGISTER_IMAGE_RELATVE_WIDTH_KEY ] ; } $ view = $ this -> initializeView ( ) ; $ view -> assignMultiple ( [ 'isAnimatedGif' => $ this -> isAnimatedGif ( $ file ) , 'config' => $ this -> getConfig ( ) , 'data' => $ GLOBALS [ 'TSFE' ] -> cObj -> data , 'file' => $ file , 'options' => $ options , ] ) ; return $ view -> render ( 'pictureTag' ) ; }
Renders a responsive image tag.

@param FileInterface $file
@param int|string $width
@param int|string $height
@param array $options
@param bool $usedPathsRelativeToCurrentScript
@return string
Renders a responsive image tag .