getConfig(); // Handle all special cases for the name if ('categories' === $category) { // List all the categories $categories = []; foreach ($configs as $key => $config) { $categories[] = $key; } $categories[] = 'all'; return $this->render('@ArdentParameter/categories.html.twig', ['categories' => $categories]); } elseif ('all' === $category) { // Show all parameters from all categories $allConfigs = []; foreach ($configs as $config) { $allConfigs = array_merge($allConfigs, $config); } return parent::baseIndex($param, $request, $allConfigs); } else { // Show the parameters from one category return parent::baseIndex($param, $request, $configs[$category]); } } }