/** * Set current object url. * * @param string $pageName * @param Controller $controller */ public function setUrl($pageName, Controller $controller) { $params = ['event_id' => $this->id . '-' . Str::slug($this->name)]; return $this->url = $controller->pageUrl($pageName, $params); }
/** * Helper that makes a URL for a page in the active theme. * @param mixed $page Specifies the Cms Page file name. * @return string */ public static function url($page, $params = [], $absolute = true) { /* * Reuse existing controller or create a new one, * assuming that the method is called not during the front-end * request processing. */ $controller = Controller::getController(); if (!$controller) { $controller = new Controller(); } return $controller->pageUrl($page, $params, true, $absolute); }
/** * Helper that makes a URL for a page in the active theme. * @param mixed $page Specifies the Cms Page file name. * @param array $params Route parameters to consider in the URL. * @return string */ public static function url($page, $params = [], $absolute = true) { /* @deprecated remove if year >= 2016 -- remove 3rd argument */ if ($absolute !== true) { traceLog('Deprecated warning: Third argument of Page::url() has no affect, consider removing it.'); } /* * Reuse existing controller or create a new one, * assuming that the method is called not during the front-end * request processing. */ $controller = Controller::getController(); if (!$controller) { $controller = new Controller(); } return $controller->pageUrl($page, $params, true); }
/** * Helper that makes a URL for a page in the active theme. * @return string */ public static function url($page, $params = []) { $controller = new Controller(); return $controller->pageUrl($page, $params); }
/** * Helper that makes a URL for a page in the active theme. * @return string */ public static function url($page, $params = [], $absolute = true) { $controller = new Controller(); return $controller->pageUrl($page, $params, true, $absolute); }
/** * @param RedirectRule $rule * @return string */ private function redirectToCmsPage(RedirectRule $rule) { $controller = new Controller(Theme::getActiveTheme()); $parameters = []; // Strip curly braces from keys foreach ($rule->getPlaceholderMatches() as $placeholder => $value) { $parameters[str_replace(['{', '}'], '', $placeholder)] = $value; } return $controller->pageUrl($rule->getCmsPage(), $parameters); }
/** * Set current object url. * * @param string $pageName * @param Controller $controller * @param array $query * @return string */ public function setUrl($pageName, Controller $controller, $query = null) { $params = ['topic_id' => $this->id . '-' . Str::slug($this->name)]; $this->url = $controller->pageUrl($pageName, $params, false); if ($query) { $this->url .= '?' . http_build_query($query); } return $this->url; }