| Conditions | 5 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | public function addRoute(): ?string |
||
| 28 | { |
||
| 29 | $model = new FormAddRoute(true); |
||
| 30 | |||
| 31 | if (!File::exist('/Private/Config/Routing.php') || !File::writable('/Private/Config/Routing.php')) { |
||
| 32 | App::$Session->getFlashBag()->add('error', __('Routing configuration file is not allowed to write: /Private/Config/Routing.php')); |
||
| 33 | } elseif ($model->send() && $model->validate()) { |
||
| 34 | $model->save(); |
||
| 35 | return $this->view->render('main/add_route_save'); |
||
| 36 | } |
||
| 37 | |||
| 38 | return $this->view->render('main/add_route', [ |
||
| 39 | 'model' => $model |
||
| 40 | ]); |
||
| 42 | } |