| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | public function getMenu():array |
||
| 34 | { |
||
| 35 | $categoryModel = new CategoryModel($this->container); |
||
| 36 | |||
| 37 | $data = []; |
||
| 38 | //get the categories from database |
||
| 39 | $categories = $categoryModel->getCategories(); |
||
| 40 | foreach ($categories as $category) { |
||
| 41 | $data += [ |
||
| 42 | $category->category_name => '/category/posts/' . $category->categories_slug |
||
| 43 | ]; |
||
| 44 | } |
||
| 45 | return $data; |
||
| 46 | } |
||
| 47 | } |