public function getCurrentUrlAffix() { $pathInfo = $this->getRequest()->getPathInfo(); //with leading / $currentUrl = $this->getCurrentUrl(); //without leading / return substr(ltrim($pathInfo, '/'), strlen($currentUrl)); }