Jinya CMS

FileExtension extends BaseExtension
in package

Provides extensions to the Plates engine, adding helper methods for image handling of files

Tags

Table of Contents

RESOLUTIONS_FOR_SOURCE  = [480, 720, 1080, 2160, 4320]
$sizesAsString  : string
pictureSources()  : string
Generates source tags for use in a picture element
register()  : void
Registers the helper method with the plates engine
sizes()  : string
Returns the sizes supported by the srcset method
srcset()  : string
Generates a srcset compatible string for use in img and picture tags

Constants

RESOLUTIONS_FOR_SOURCE

public array<string|int, int> RESOLUTIONS_FOR_SOURCE = [480, 720, 1080, 2160, 4320]

The default resolutions supported by Jinya CMS

Tags

Properties

$sizesAsString

private string $sizesAsString = '100vw'

The default sizes property supported by Jinya CMS

Tags

Methods

pictureSources()

Generates source tags for use in a picture element

public pictureSources(File $file, ImageType ...$imageType) : string
Parameters
$file : File
$imageType : ImageType
Tags
Return values
string

register()

Registers the helper method with the plates engine

public register(Engine $engine) : void
Parameters
$engine : Engine
Tags
Return values
void

sizes()

Returns the sizes supported by the srcset method

public sizes() : string
Tags
Return values
string

srcset()

Generates a srcset compatible string for use in img and picture tags

public srcset(File $file[, ImageType|false $imageType = false ]) : string
Parameters
$file : File
$imageType : ImageType|false = false
Tags
throws
RuntimeException
Return values
string

Search results