PictureTag
class PictureTag extends BaseTag
Generates an HTML <picture>
tag containing <source>
and <img>
tags.
For example:
<picture>
<source srcset="https://res.cloudinary.com/demo/image/upload/c_scale,w_500/sample.png" media="(max-width: 500px)">
<source srcset="https://res.cloudinary.com/demo/image/upload/c_scale,w_1000/sample.png" media="(min-width: 500px)">
<img src="https://res.cloudinary.com/demo/image/upload/sample.png">
</picture>
Properties
Configuration | $config | from BaseTag | |
ImageTag | $imageTag | ||
array | $sources |
Methods
Image format of the video poster.
Use fetch format transformation ("f_") instead of file extension.
PictureTag constructor.
Imports (merges) the configuration.
Adds a tag class.
Resets tag classes and sets the specified one.
Sets tag attribute.
Sets (multiple) tag attributes.
Deletes tag attribute.
Adds tag content.
Sets the content of the tag to the specified one.
Serializes the tag to string.
Serializes the tag content.
Serializes the tag attributes.
Serializes the tag to string.
Serializes the tag to string.
Static builder for uploaded asset image tag.
Static builder for fetch image tag (from URL).
Static builder for facebook profile picture tag.
Static builder for gravatar profile picture tag.
Static builder for twitter profile picture tag.
Static builder for twitter profile picture by name.
Static builder for the thumbnail of the YouTube video.
Static builder for the thumbnail of the YouTube video.
Static builder for the thumbnail of the Vimeo video.
Static builder for the thumbnail of the animoto video.
Static builder for the thumbnail of the World Star Hip Hop video.
Static builder for the thumbnail of the DailyMotion video.
Static builder for sprite tag.
Sets the image of the picture.
Sets the tag sources.
Details
$this
videoPosterFormat(string $format)
Image format of the video poster.
$this
useFetchFormat(bool $useFetchFormat = true)
Use fetch format transformation ("f_") instead of file extension.
__construct(string|Image $source, array $sources, Configuration|string|array|null $configuration = null)
PictureTag constructor.
Configuration
configuration(Configuration|string|array|null $configuration)
Sets the configuration.
BaseTag
importConfiguration(Configuration|string|array|null $configuration)
Imports (merges) the configuration.
BaseTag
addClass(string|array $class)
Adds a tag class.
BaseTag
setClass(string|array $class)
Resets tag classes and sets the specified one.
BaseTag
setAttribute(string $key, mixed $value = null)
Sets tag attribute.
BaseTag
setAttributes(array $attributes)
Sets (multiple) tag attributes.
BaseTag
deleteAttribute(string $key)
Deletes tag attribute.
$this
addContent(mixed $content, mixed $key = null)
Adds tag content.
BaseTag
setContent(mixed $content)
Sets the content of the tag to the specified one.
string
serialize()
Serializes the tag to string.
string
serializeContent(array $additionalContent = [], bool $prependAdditionalContent = false)
Serializes the tag content.
string
serializeAttributes(array $attributes = [])
Serializes the tag attributes.
string
toTag()
Serializes the tag to string.
string
__toString()
Serializes the tag to string.
static ImageTagDeliveryTypeTrait
upload(string $publicId, Configuration|string|array|null $configuration = null)
Static builder for uploaded asset image tag.
static ImageTagDeliveryTypeTrait
fetch(string $url, Configuration|string|array|null $configuration = null)
Static builder for fetch image tag (from URL).
static ImageTagDeliveryTypeTrait
facebook(string $facebookId, Configuration|string|array|null $configuration = null)
Static builder for facebook profile picture tag.
static ImageTagDeliveryTypeTrait
gravatar(string $email, Configuration|string|array|null $configuration = null)
Static builder for gravatar profile picture tag.
static ImageTagDeliveryTypeTrait
twitter(string $userId, Configuration|string|array|null $configuration = null)
Static builder for twitter profile picture tag.
static ImageTagDeliveryTypeTrait
twitterName(string $username, Configuration|string|array|null $configuration = null)
Static builder for twitter profile picture by name.
static ImageTagDeliveryTypeTrait
youTube(string $videoId, Configuration|string|array|null $configuration = null)
Static builder for the thumbnail of the YouTube video.
static ImageTagDeliveryTypeTrait
hulu(string $videoId, Configuration|string|array|null $configuration = null)
Static builder for the thumbnail of the YouTube video.
static ImageTagDeliveryTypeTrait
vimeo(string $videoId, Configuration|string|array|null $configuration = null)
Static builder for the thumbnail of the Vimeo video.
static ImageTagDeliveryTypeTrait
animoto(string $videoId, Configuration|string|array|null $configuration = null)
Static builder for the thumbnail of the animoto video.
static ImageTagDeliveryTypeTrait
worldStarHipHop(string $videoId, Configuration|string|array|null $configuration = null)
Static builder for the thumbnail of the World Star Hip Hop video.
static ImageTagDeliveryTypeTrait
dailyMotion(string $videoId, Configuration|string|array|null $configuration = null)
Static builder for the thumbnail of the DailyMotion video.
static ImageTagDeliveryTypeTrait
sprite(string $tag, Configuration|string|array|null $configuration = null)
Static builder for sprite tag.
PictureTag
image(mixed $image)
Sets the image of the picture.
PictureTag
setSources(array $sourcesDefinitions)
Sets the tag sources.
Constants
SINGLE_QUOTES |
|
DOUBLE_QUOTES |
|
NAME |
|
IS_VOID |
|