|
@@ 106-120 (lines=15) @@
|
| 103 |
|
* |
| 104 |
|
* @return mixed|string |
| 105 |
|
*/ |
| 106 |
|
public function generateBackgroundImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $pictureSetName, $selector) |
| 107 |
|
{ |
| 108 |
|
$cssData = $this->styleManager->getPictureData($image, $pictureSetName); |
| 109 |
|
$this->convertPathsToUrls($cssData, ['fallback', 'sources']); |
| 110 |
|
|
| 111 |
|
return $environment->render( |
| 112 |
|
'ResponsiveImageBundle::css.html.twig', |
| 113 |
|
[ |
| 114 |
|
'fallback' => $cssData['fallback'], |
| 115 |
|
'sources' => $cssData['sources'], |
| 116 |
|
'image' => $image, |
| 117 |
|
'selector' => $selector, |
| 118 |
|
] |
| 119 |
|
); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
/** |
| 123 |
|
* @param \Twig_Environment $environment |
|
@@ 130-143 (lines=14) @@
|
| 127 |
|
* |
| 128 |
|
* @return mixed|string |
| 129 |
|
*/ |
| 130 |
|
public function generatePictureImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $pictureSetName, $generate = false) |
| 131 |
|
{ |
| 132 |
|
$pictureData = $this->styleManager->getPictureData($image, $pictureSetName); |
| 133 |
|
$this->convertPathsToUrls($pictureData, ['fallback', 'sources']); |
| 134 |
|
|
| 135 |
|
return $environment->render( |
| 136 |
|
'ResponsiveImageBundle::picture.html.twig', |
| 137 |
|
[ |
| 138 |
|
'fallback' => $pictureData['fallback'], |
| 139 |
|
'sources' => $pictureData['sources'], |
| 140 |
|
'image' => $image, |
| 141 |
|
] |
| 142 |
|
); |
| 143 |
|
} |
| 144 |
|
|
| 145 |
|
/** |
| 146 |
|
* @internal |