Contao\Image::getResizedPath PHP Méthode

getResizedPath() public méthode

Get the path of the resized image
public getResizedPath ( ) : string
Résultat string The path of the resized image
    public function getResizedPath()
    {
        $path = $this->resizedPath;
        // Strip the web/ prefix (see #337)
        if (strncmp($path, 'web/', 4) === 0) {
            $path = substr($path, 4);
        }
        return $path;
    }

Usage Example

 /**
  * Tests the getImage hook.
  */
 public function testExecuteResizeHook()
 {
     $GLOBALS['TL_HOOKS']['getImage'][] = [get_class($this), 'getImageHookCallback'];
     $file = new \File('dummy.jpg');
     $imageObj = new Image($file);
     $imageObj->setTargetWidth(100)->setTargetHeight(100);
     $imageObj->executeResize();
     $this->assertSame($imageObj->getResizedPath(), 'dummy.jpg%3B100%3B100%3Bcrop%3BContao%5CFile%3B%3BContao%5CImage');
 }
All Usage Examples Of Contao\Image::getResizedPath