PHP Класс Heyday\ResponsiveImages\ResponsiveImageExtension
Image sets are defined in the config layer, e.g:
Heyday\ResponsiveImages\ResponsiveImageExtension:
sets:
MyResponsiveImageSet:
method: CroppedImage
arguments:
"(min-width: 200px)": [200, 100]
"(min-width: 800px)": [200, 400]
"(min-width: 1200px) and (min-device-pixel-ratio: 2.0)": [800, 400]
default_arguments: [200, 400]
This provides $MyImage.MyResponsiveImageSet to the template. For more
documentation on implementation, see the README file.
Показать файл
Открыть проект
Защищенные свойства (Protected)
Свойство |
Тип |
Описание |
|
$configSets |
|
A cached copy of the image sets |
|
Открытые методы
Метод |
Описание |
|
__call ( string $method, array $args ) : HTMLText |
A wildcard method for handling responsive sets as template functions,
e.g. $MyImage.ResponsiveSet1 |
|
__construct ( ) |
|
|
allMethodNames ( ) : array |
Defines all the methods that can be called in this class. |
|
Защищенные методы
Метод |
Описание |
|
createResponsiveSet ( array $config, array $defaultArgs, string $set ) : SSViewer |
Requires the necessary JS and sends the required HTML structure to the
template for a responsive image set. |
|
getConfigForSet ( string $setName ) : array | false |
Due to {@link Object::allMethodNames()} requiring methods to be expressed
in all lowercase, getting the config for a given method requires a
case-insensitive comparison. |
|
getResponsiveSets ( ) : array |
Returns a list of available image sets. |
|
Описание методов
A wildcard method for handling responsive sets as template functions,
e.g. $MyImage.ResponsiveSet1
public __call ( string $method, array $args ) : HTMLText |
$method |
string |
The method called |
$args |
array |
The arguments passed to the method |
Результат |
HTMLText |
|
__construct()
публичный Метод
allMethodNames()
публичный Метод
Defines all the methods that can be called in this class.
createResponsiveSet()
защищенный Метод
Requires the necessary JS and sends the required HTML structure to the
template for a responsive image set.
protected createResponsiveSet ( array $config, array $defaultArgs, string $set ) : SSViewer |
$config |
array |
The configuration of the responsive image set |
$defaultArgs |
array |
The arguments passed to the responsive image
method call, e.g. $MyImage.ResponsiveSet(800x600) |
$set |
string |
The method, or responsive image set, to generate |
Результат |
SSViewer |
|
getConfigForSet()
защищенный Метод
Due to {@link Object::allMethodNames()} requiring methods to be expressed
in all lowercase, getting the config for a given method requires a
case-insensitive comparison.
getResponsiveSets()
защищенный Метод
Returns a list of available image sets.
Описание свойств
$configSets защищенное свойство
A cached copy of the image sets