/** * Generates a dynamic route with replaced parameters * * @param array $replacements * * @return string */ public function getDynamicPath(array $replacements = []) { $route = $this->requestHelper->getAttributesBagParam('_route'); $currentAttributesParams = $this->requestHelper->getAttributesBagParam('_route_params'); $currentQueryParams = $this->requestHelper->getCurrentRequest()->query->all(); $routeParams = array_replace($currentAttributesParams, $replacements); $routeParams = array_merge($routeParams, $currentQueryParams); return $this->generator->generate($route, $routeParams); }
/** * {@inheritdoc} */ public function getCurrentRoute() { $routeName = $this->requestHelper->getAttributesBagParam('_route'); $route = $this->router->getRouteCollection()->get($routeName); if (null === $route) { throw new \RuntimeException('Cannot determine current route from request'); } return $this->router->getRouteCollection()->get($routeName); }
private function isSortingActive(string $column, string $direction) : bool { $currentOrderBy = $this->requestHelper->getAttributesBagParam('orderBy'); $currentOrderDir = $this->requestHelper->getAttributesBagParam('orderDir'); return $column === $currentOrderBy && $direction === $currentOrderDir; }
/** * Checks whether the sorting option is active * * @param $column * @param $direction * * @return bool */ protected function checkSortingIsActive($column, $direction) { $currentOrderBy = $this->requestHelper->getAttributesBagParam('orderBy'); $currentOrderDir = $this->requestHelper->getAttributesBagParam('orderDir'); return $column === $currentOrderBy && $direction === $currentOrderDir; }
public function getCurrentRouteName() : string { return $this->requestHelper->getAttributesBagParam('_route'); }
/** * Checks whether passed route is the same as in request * * @param string $route * * @return bool */ public function checkRouteIsActive($route) { $currentRoute = $this->requestHelper->getAttributesBagParam('_route'); return $route === $currentRoute; }