Skip to content

Commit

Permalink
Merge pull request #238 from eryx12o45/add_alt_param_to_getHtml_function
Browse files Browse the repository at this point in the history
Add 'alt' param to getHtml function
  • Loading branch information
wtfzdotnet authored Aug 18, 2021
2 parents 88f7dd9 + 916dd74 commit 9467619
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Tmdb/Helper/ImageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ public function getImageConfiguration()
* @param string $size
* @param int|null $width
* @param int|null $height
* @param string $alt
* @param string $title
* @return string
*/
public function getHtml($image, $size = 'original', $width = null, $height = null)
public function getHtml($image, $size = 'original', $width = null, $height = null, $alt = '', $title = '')
{
if ($image instanceof Image) {
if (null == $image->getFilePath()) {
Expand All @@ -86,10 +88,12 @@ public function getHtml($image, $size = 'original', $width = null, $height = nul
}

return sprintf(
'<img src="%s" width="%s" height="%s" />',
'<img src="%s" width="%s" height="%s" title="%s" alt="%s"/>',
$this->getUrl($image, $size),
$width,
$height
$height,
$title,
$alt
);
}

Expand Down

0 comments on commit 9467619

Please sign in to comment.