Conditions | 3 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function actionIndex($file) |
||
28 | { |
||
29 | $title = 'PDF Viewer'; |
||
30 | $sections = []; |
||
31 | if (Yii::$app->request->getIsPost()) { |
||
32 | /** @var array $sections */ |
||
33 | $sections = Yii::$app->request->post(); |
||
34 | $title = $sections['title'] ?? 'PDF Viewer: ' . $file; |
||
35 | unset($sections[Yii::$app->request->csrfParam]); |
||
36 | unset($sections['title']); |
||
37 | |||
38 | foreach ($sections as $section => $show) { |
||
39 | $sections[$section] = $show != 0; |
||
40 | } |
||
41 | } |
||
42 | |||
43 | return $this->render('index', [ |
||
44 | 'title' => $title, |
||
45 | 'sections' => $sections, |
||
46 | ]); |
||
49 |