/** * Redirect to a page */ public static function page(Page $c, $code = 302, $headers = array()) { if ($c->getCollectionPath()) { $url = BASE_URL . URL::to($c->getCollectionPath()); } else { $url = BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $c->getCollectionID(); } $r = static::createRedirectResponse($url, $code, $headers); return $r; }
/** * Redirect to a page */ public static function page(Page $c, $code = 302, $headers = array()) { if ($c->getCollectionPath()) { $url = Core::make('helper/navigation')->getLinkToCollection($c, true); } else { $url = \URL::to($c); } $r = static::createRedirectResponse((string) $url, $code, $headers); return $r; }