Merge remote-tracking branch 'skl85/hotfix-extautodetect'
[phorkie.git] / src / phorkie / Renderer / Image.php
1 <?php
2 namespace phorkie;
3
4 class Renderer_Image
5 {
6     /**
7      * Converts the code to HTML
8      *
9      * @param File        $file File to render
10      * @param Tool_Result $res  Tool result to integrate
11      *
12      * @return string HTML
13      */
14     public function toHtml(File $file, Tool_Result $res = null)
15     {
16         return '<div class="image">'
17             . '<img'
18             . ' src="' . htmlspecialchars($file->getLink('raw')) . '"'
19             . ' alt="' . htmlspecialchars($file->getFilename()) . '"'
20             . '/>'
21             . '</div>';
22     }
23 }
24 ?>