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.
파일 보기
프로젝트 열기: heyday/silverstripe-responsive-images
보호된 프로퍼티들
공개 메소드들
메소드 |
설명 |
|
__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 |
|
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.
프로퍼티 상세
A cached copy of the image sets