request->getParam('controller')); $action = \Cake\Utility\Inflector::variable($this->request->getParam('action')); $currentURL = "/{$controller}/{$action}"; if ($url == $currentURL) { $active = true; } $hasActiveChild = false; if (!empty($children)) { $flattened = Cake\Utility\Hash::flatten($children); $flattenedValues = array_values($flattened); if (in_array($currentURL, $flattenedValues)) { $hasActiveChild = true; } } ?>