Extension App + travelsearch
git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3481 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
645dbaf77e
commit
30c42d0508
2 changed files with 111 additions and 20 deletions
|
|
@ -120,6 +120,7 @@ class AppExtension extends \Twig_Extension
|
|||
|
||||
public function lozadFilter($html)
|
||||
{
|
||||
// return $html;
|
||||
//(<img\s*?)src
|
||||
$dom = new \DOMDocument;
|
||||
$dom->loadHTML('<?xml encoding="utf-8" ?>'.$html);
|
||||
|
|
@ -127,16 +128,16 @@ class AppExtension extends \Twig_Extension
|
|||
foreach ($images as $image) {
|
||||
|
||||
$i = Util::getRootDir().'web/'.$image->getAttribute('src');
|
||||
if(strpos($image->getAttribute('src'), 'docs')){
|
||||
if(strpos($image->getAttribute('src'), 'docs') !== false){
|
||||
$i = Util::getRootDir().'web/'.substr($image->getAttribute('src'), strpos($image->getAttribute('src'), 'docs'));
|
||||
}
|
||||
if(strpos($image->getAttribute('src'), 'uploads')){
|
||||
if(strpos($image->getAttribute('src'), 'uploads') !== false){
|
||||
$i = Util::getRootDir().'web/'.substr($image->getAttribute('src'), strpos($image->getAttribute('src'), 'uploads'));
|
||||
}
|
||||
|
||||
$i = Image::open($i)->cropResize(848)->guess(75);
|
||||
|
||||
// $i = image()..;
|
||||
$image->setAttribute('data-src', $i);
|
||||
$image->setAttribute('data-src', "/".$i);
|
||||
$image->setAttribute('src', 'images/placeholder-image.png');
|
||||
$image->setAttribute('class', 'lozad');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue