在Laravel 5刀片模板中包含SVG文件(位于assets文件夹中)的内容的最佳方法是什么?
我不想使用image/object/embed标签,出于速度原因,这应该是内联SVG.
我知道我可以使用<?php file_get_contents("file.svg") ?>但是有更好的方法特定于Laravel/Blade吗?
编辑:澄清一下,该方法应该适用于所有 SVG文件,包括下面的文件.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path stroke="red" fill="#00f" d="M10 10h100v100H10z"/>
</svg>
Run Code Online (Sandbox Code Playgroud) 在AuthenticatesAndRegistersUsersLaravel的默认AuthController类使用的特性中,使用以下代码:
return redirect()->intended($this->redirectPath());
Run Code Online (Sandbox Code Playgroud)
该redirectPath()功能如下:
public function redirectPath()
{
if (property_exists($this, 'redirectPath'))
{
return $this->redirectPath;
}
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
}
Run Code Online (Sandbox Code Playgroud)
阅读此代码,我可以在AuthController类上设置两个不同的属性:redirectPath和redirectTo.redirectPath优先于redirectTo.
当我想更改默认页面以重定向/home到/我时,我认为最好设置redirectTo属性.该redirectPath物业的用途是什么?