Word-wrap for txt files
[phorkie.git] / src / phorkie / Renderer / Plaintext.php
1 <?php
2 namespace phorkie;
3
4 /**
5  * Render plain .txt files
6  */
7 class Renderer_Plaintext
8 {
9     /**
10      * Simply displays the file
11      *
12      * @param File $file File to render
13      *
14      * @return string HTML
15      */
16     public function toHtml(File $file)
17     {
18         $html = '<div class="code"><pre class="txt">'
19             . htmlspecialchars($file->getContent())
20             . '</pre></div>' . "\n";
21         return $html;
22     }
23 }
24
25 ?>