SilverStripe\CMS\Controllers\RootURLController
Synopsis
class RootURLController
extends Controller
implements
Resettable
{
- // members
- protected static bool $is_at_root = false;
- private static string $default_homepage_link = 'home';
- protected static $cached_homepage_link;
- // methods
- public static string get_homepage_link()
- public static bool should_be_on_root()
- public static void reset()
- protected void beforeHandleRequest()
- public HTTPResponse handleRequest()
Hierarchy
Extends
- SilverStripe\Control\Controller
Implements
- SilverStripe\Core\Resettable
Members
private
- $default_homepage_link — string
protected
- $cached_homepage_link — string
- $is_at_root — SilverStripe\CMS\Controllers\bool
Methods
protected
public
- get_homepage_link() — Get the full form (e.g. /home/) relative link to the home page for the current HTTP_HOST value. Note that the link is trimmed of leading and trailing slashes before returning to ensure consistency.
- handleRequest()
- reset() — Resets the cached homepage link value - useful for testing.
- should_be_on_root() — Returns TRUE if a request to a certain page should be redirected to the site root (i.e. if the page acts as the home page).