Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このベース URL を取得するにはどうすればよいですか
http://localhost/Symfony/web/app_dev.php/
また
http://localhost/Symfony/web/app.php/
http://localhost/Symfony/web/
(ベース URL)
symfony2 設定ファイルで? symfony のウェブサイトで見つけることができません。
うーん...これをチェックしてください:
$base = $this->getRequest()->getSchemeAndHttpHost();
または最も古いバージョン(いつ変更されたかは覚えていません):
$request = $this->getRequest(); $scheme = $request->getScheme(); $host = $request->getHttpHost(); $base = sprintf('%s://%s', $scheme, $host);