如题
修改助手函数
/**
* @param string $template
* @param array $vars
* @param null $app
* @return Response
*/
function view(string $template='', array $vars = [], $app = null): Response
{
$controllerClass = request()->controller;
$controller = substr($controllerClass,strrpos($controllerClass,DIRECTORY_SEPARATOR)+1);
$template= $template?: $controller .DIRECTORY_SEPARATOR.request()->action ;
static $handler;
if (null === $handler) {
$handler = config('view.handler');
}
return new Response(200, [], $handler::render($template, $vars, $app));
}
mark