Laravel 5 Laravel 5辅助函数
有人知道内置的Laravel 5帮助函数(如view()和str_limit())的源代码在哪里吗?我很想看看他们在后台是怎么做的。查看功能位于Laravel 5 Laravel 5辅助函数,laravel-5,Laravel 5,有人知道内置的Laravel 5帮助函数(如view()和str_limit())的源代码在哪里吗?我很想看看他们在后台是怎么做的。查看功能位于 /vendor/laravel/framework/source/illuminate/Foundation/helpers.php 线路号585 内容如下: if ( ! function_exists('view')) { /** * Get the evaluated view contents for the given view. *
/vendor/laravel/framework/source/illuminate/Foundation/helpers.php
线路号585
内容如下:
if ( ! function_exists('view'))
{
/**
* Get the evaluated view contents for the given view.
*
* @param string $view
* @param array $data
* @param array $mergeData
* @return \Illuminate\View\View
*/
function view($view = null, $data = array(), $mergeData = array())
{
$factory = app('Illuminate\Contracts\View\Factory');
if (func_num_args() === 0)
{
return $factory;
}
return $factory->make($view, $data, $mergeData);
}
}
开始使用像PHPStorm这样的IDE,只需单击一下就可以找到所有这些函数