Laravel 5 redirect
函数源代码在哪里?
我使用ag "function redirect"
搜索定义的位置,但我什么都没有。
所以我想知道它在哪里,为什么以及如何。
答案 0 :(得分:1)
它位于vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
:
function redirect($to = null, $status = 302, $headers = [], $secure = null)
{
if (is_null($to)) {
return app('redirect');
}
return app('redirect')->to($to, $status, $headers, $secure);
}
答案 1 :(得分:0)
因为ag
忽略了vcs忽略(.gitignore,.hgignore;仍然服从.ignore),现在我得到了我想要的东西:使用ag --php --skip-vcs-ignores "function redirect\("
vendor/laravel/framework/src/Illuminate/Foundation/helpers.php
604: function redirect($to = null, $status = 302, $headers = [], $secure = null)
vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php
30: public function redirect($path, $route, $scheme = null);
vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php
22: public function redirect($path, $route, $scheme = null)