Request::getBasePath PHP Method

getBasePath() public static method

Suppose that an index.php file instantiates this request object: * http://localhost/index.php returns an empty string * http://localhost/index.php/page returns an empty string * http://localhost/web/index.php returns '/web' * http://localhost/we%20b/index.php returns '/we%20b'
public static getBasePath ( ) : string
return string The raw path (i.e. not urldecoded)
        public static function getBasePath()
        {
            //Method inherited from \Symfony\Component\HttpFoundation\Request
            return \Illuminate\Http\Request::getBasePath();
        }

Usage Example

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"utf-8\"/>\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n\n    <title>Webook Login</title>\n    <link rel=\"shortcut icon\" href=\"/themes/stanfour4/assets/favicon.png\">\n\n    <!--Google Font - Work Sans-->\n    <link href='https://fonts.googleapis.com/css?family=Raleway:400,700' rel='stylesheet' type='text/css'>\n    \n    <link rel=\"stylesheet\" href=\"";
     // line 14
     echo $this->env->getExtension('CMS')->themeFilter(array(0 => "assets/elastic-login-form/css/style.css"));
     // line 15
     echo "\">\n\n    <!-- CSS for IE -->\n    <!--[if lte IE 9]>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"themes/stanfour4/assets/css/ie.css\" />\n    <![endif]-->\n\n    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->\n    <!--[if lt IE 9]>\n    <script src=\"themes/stanfour4/assets/js/html5shiv.js\"></script>\n    <script src=\"themes/stanfour4/assets/js/respond.min.js\"></script>\n    <![endif]-->\n</head>\n<body>\n    ";
     // line 29
     $context['__cms_component_params'] = [];
     echo $this->env->getExtension('CMS')->componentFunction("session", $context['__cms_component_params']);
     unset($context['__cms_component_params']);
     // line 30
     echo "\n    <div class=\"container\">\n        <div class=\"profile\">\n            <button class=\"profile__avatar\" id=\"toggleProfile\">\n                <img src=\"/themes/stanfour4/assets/logo.svg\" alt=\"Avatar\" /> \n            </button>\n            ";
     // line 36
     $context['__cms_component_params'] = [];
     echo $this->env->getExtension('CMS')->componentFunction("account", $context['__cms_component_params']);
     unset($context['__cms_component_params']);
     // line 37
     echo "        </div>\n    </div>\n    \n<script src=\"";
     // line 40
     echo $this->env->getExtension('CMS')->themeFilter(array(0 => "assets/js/jquery-1.11.3.min.js", 1 => "assets/elastic-login-form/js/index.js"));
     echo "\"></script>\n";
     // line 41
     echo '<script src="' . Request::getBasePath() . '/modules/system/assets/js/framework.js"></script>' . PHP_EOL;
     echo '<script src="' . Request::getBasePath() . '/modules/system/assets/js/framework.extras.js"></script>' . PHP_EOL;
     echo '<link href="' . Request::getBasePath() . '/modules/system/assets/css/framework.extras.css" rel="stylesheet">' . PHP_EOL;
     // line 42
     echo "</body>\n</html>";
 }
All Usage Examples Of Request::getBasePath