| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function cache(): ?string |
||
| 25 | { |
||
| 26 | // check if submited |
||
| 27 | if ($this->request->request->get('clearcache', false)) { |
||
| 28 | // clear cache |
||
| 29 | App::$Cache->clear(); |
||
| 30 | // add notification & redirect |
||
| 31 | App::$Session->getFlashBag()->add('success', __('Cache cleared successfully')); |
||
| 32 | $this->response->redirect('/'); |
||
| 33 | } |
||
| 34 | |||
| 35 | // render output view |
||
| 36 | return $this->view->render('main/clear_cache'); |
||
| 37 | } |
||
| 38 | } |