function ImageStyle::getPathToken
Same name in other branches
- 9 core/modules/image/src/Entity/ImageStyle.php \Drupal\image\Entity\ImageStyle::getPathToken()
- 8.9.x core/modules/image/src/Entity/ImageStyle.php \Drupal\image\Entity\ImageStyle::getPathToken()
- 11.x core/modules/image/src/Entity/ImageStyle.php \Drupal\image\Entity\ImageStyle::getPathToken()
Overrides ImageStyleInterface::getPathToken
1 call to ImageStyle::getPathToken()
- ImageStyle::buildUrl in core/
modules/ image/ src/ Entity/ ImageStyle.php - Returns the URL of this image derivative for an original image path or URI.
File
-
core/
modules/ image/ src/ Entity/ ImageStyle.php, line 366
Class
- ImageStyle
- Defines an image style configuration entity.
Namespace
Drupal\image\EntityCode
public function getPathToken($uri) {
// Return the first 8 characters.
return substr(Crypt::hmacBase64($this->id() . ':' . $this->addExtension($uri), $this->getPrivateKey() . $this->getHashSalt()), 0, 8);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.