aboutsummaryrefslogtreecommitdiff
path: root/src/phorkie/Renderer/Image.php
blob: 9425646855c43c69773b9319244060fa02878ce3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
namespace phorkie;

class Renderer_Image
{
    /**
     * Converts the code to HTML
     *
     * @param File        $file File to render
     * @param Tool_Result $res  Tool result to integrate
     *
     * @return string HTML
     */
    public function toHtml(File $file, Tool_Result $res = null)
    {
        return '<div class="image">'
            . '<img'
            . ' src="' . htmlspecialchars($file->getLink('raw')) . '"'
            . ' alt="' . htmlspecialchars($file->getFilename()) . '"'
            . '/>'
            . '</div>';
    }
}
?>