public function parseContext() { $segments = $this->request->getUrlSegments(); $identifier = array_shift($segments); switch ($identifier) { case 'ajax': $page = array_shift($segments); if ($page === 'view') { $view = implode('/', $segments); return "view:{$view}"; } else { if ($page === 'form') { $form = implode('/', $segments); return "form:{$form}"; } } array_unshift($segments, $page); break; case 'action': $action = implode('/', $segments); return "action:{$action}"; } array_unshift($segments, $identifier); $path = implode('/', $segments); return "path:{$path}"; }