Total Complexity | 3 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class DocController extends AbstractController |
||
12 | { |
||
13 | /// @todo get this injected |
||
14 | protected $docRoot = '/var/www/doc'; |
||
15 | |||
16 | /** |
||
17 | * @Route("/list", name="doc_list") |
||
18 | */ |
||
19 | public function list() |
||
20 | { |
||
21 | $docs = glob($this->docRoot . '/*.md'); |
||
22 | array_walk($docs, function(&$path, $key) {$path = basename($path);}); |
||
23 | return $this->render('Doc/list.html.twig', ['docs' => $docs]); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @Route("/view/{filename}", name="doc_view") |
||
28 | * |
||
29 | * @param string $filename |
||
30 | * @return \Symfony\Component\HttpFoundation\Response |
||
31 | */ |
||
32 | public function displayFile($filename) |
||
45 | } |
||
46 | } |
||
47 |