获取当前 URL 很容易:
Request::url()
Run Code Online (Sandbox Code Playgroud)
这将返回如下内容:
http://localhost/some/or/other/path
Run Code Online (Sandbox Code Playgroud)
但是,如果我想要一种简单的方法来获得:
some/or/other/path
Run Code Online (Sandbox Code Playgroud)
我会怎么做?有没有办法在没有 parse_url 的情况下做到这一点?即 Laravel 是否有一个固有的内置方式来做到这一点?
| 归档时间: |
|
| 查看次数: |
2025 次 |
| 最近记录: |