Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function displayFile($filename) |
||
33 | { |
||
34 | // sanitize |
||
35 | $filename = basename($filename); |
||
36 | |||
37 | $filename = $this->docRoot . '/' . $filename; |
||
38 | |||
39 | if (!is_file($filename)) { |
||
40 | throw $this->createNotFoundException("The doc file '$filename' does not exist"); |
||
41 | } |
||
42 | |||
43 | /// @todo allow different types of doc format |
||
44 | return $this->render('Doc/File/markdown.html.twig', ['file' => basename($filename), 'markup' => file_get_contents($filename)]); |
||
45 | } |
||
47 |