aboutsummaryrefslogtreecommitdiff
path: root/src/phorkie/Renderer/Plaintext.php
blob: ef448f94b9cf00cc049619e3172d2527387988ba (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
25
<?php
namespace phorkie;

/**
 * Render plain .txt files
 */
class Renderer_Plaintext
{
    /**
     * Simply displays the file
     *
     * @param File $file File to render
     *
     * @return string HTML
     */
    public function toHtml(File $file)
    {
        $html = '<div class="code"><pre class="txt">'
            . htmlspecialchars($file->getContent())
            . '</pre></div>' . "\n";
        return $html;
    }
}

?>