diff options
Diffstat (limited to 'src/phorkie/Renderer/Image.php')
| -rw-r--r-- | src/phorkie/Renderer/Image.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/phorkie/Renderer/Image.php b/src/phorkie/Renderer/Image.php new file mode 100644 index 0000000..9425646 --- /dev/null +++ b/src/phorkie/Renderer/Image.php @@ -0,0 +1,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>'; + } +} +?> |
