Добален исправленный вариант получения ссылки на оригинальное фото

This commit is contained in:
Krivchikov Dmitry 2015-08-30 12:56:02 +03:00
parent a8e78d22ab
commit bb58d29fec
2 changed files with 10 additions and 1 deletions

View File

@ -16,4 +16,13 @@ class Photo extends Model
return new self();
}
/**
* Возвращает ссылку на исходное изображение (если она есть)
* @return type
*/
function getOriginalLink()
{
$link = $this->link;
return $link ? $link->url : '';
}
}

View File

@ -45,7 +45,7 @@ $index = 0;
<?php endif; ?>
<?php if ($photos): ?>
<?php foreach ($photos as $photo): ?>
<img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>">
<img data-thumb="/photos/small/<?= $photo->name ?>" src="/photos/middle/<?= $photo->name ?>" data-caption="<?= $photo->getOriginalLink()?>">
<?php endforeach; ?>
<?php endif; ?>
<span data-thumb="/img/mapThumb.png">