Last active
December 22, 2015 01:58
-
-
Save tim-bec/6399626 to your computer and use it in GitHub Desktop.
Contao Image-Prozessing for responsive images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->import('Environment'); | |
$ua = $this->Environment->agent; // Import User Agent class | |
// check if agent is mobile | |
if($ua->mobile) { | |
$image_link = $arrItem['raw']['picture']; // load picture url | |
$image = $this->getImage($image_link,1024,768,'proportional'); // create thumb $link, $w,$h,$cropmode | |
} | |
// if not, deliver the full picture | |
else { | |
$image = $arrItem['raw']['picture']; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment