Back to AdministratorApplication class

Method route

protected void
route
()
Route the application.
Returns
  • void
Since
  • 3.2

Method route - Source code

/**
 * Route the application.
 *
 * Routing is the process of examining the request environment to determine which
 * component should receive the request. The component optional parameters
 * are then set in the request object to be processed when the application is being
 * dispatched.
 *
 * @return  void
 *
 * @since   3.2
 */
protected function route()
{
    $uri = Uri::getInstance();
    if ($this->get('force_ssl') >= 1 && strtolower($uri->getScheme()) !== 'https') {
        // Forward to https
        $uri->setScheme('https');
        $this->redirect((string) $uri, 301);
    }
    if ($this->isTwoFactorAuthenticationRequired()) {
        $this->redirectIfTwoFactorAuthenticationRequired();
    }
    // Trigger the onAfterRoute event.
    PluginHelper::importPlugin('system');
    $this->triggerEvent('onAfterRoute');
}