【问题标题】:How to the domain url in laravel5如何在 laravel5 中获取域 url
【发布时间】:2016-01-17 08:25:54
【问题描述】:

我必须在 laravel Blade 中获取域 url(例如http://www.example.com/)。我试过使用 {{ url() }} 但它返回到我的公共目录的路径。是否有任何一条线功能可以得到这个?如何在刀片中获取域?需要帮忙。谢谢。

【问题讨论】:

  • 你的意思是现在它返回 'var/www/app/public' 或 'www.app.com/public' ?
  • 试试{{ Request::root() }}
  • 不,我只需要'www.example.com'

标签: laravel url


【解决方案1】:

你也可以试试

{{ Request::server ("SERVER_NAME") }} {{ Request::server ("SERVER_NAME") }}

或者一起去 {{ Request::root() }}

【讨论】:

    猜你喜欢
    • 2014-09-19
    • 2017-01-26
    • 2010-10-08
    • 2010-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多