spatie / laravel-blade
1.0.2
2017-07-03 12:59 UTC
Requires
- illuminate/view: 4.1.*
README
此包未维护
在Laravel之外使用Laravel的Blade
此包是50onred/laravel-blade的略微修改版本。
安装
composer require spatie/laravel-blade
Postcardware
您可以自由使用此包(它是MIT许可的),但如果它进入了您的生产环境,您需要向我们从您家乡寄一张明信片,提及您正在使用我们哪个包。
我们的地址是:Spatie,Samberstraat 69D,2060 安特卫普,比利时。
最好的明信片将在我们网站的开源页面上发布。
用法
<?php /* |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader | for our application. We just need to utilize it! We'll require it | into the script here so that we do not have to worry about the | loading of any our classes "manually". Feels great to relax. | */ require 'vendor/autoload.php'; use Spatie\Blade\Blade; $views = __DIR__ . '/views'; $cache = __DIR__ . '/cache'; $blade = new Blade($views, $cache); echo $blade->view()->make('hello');
您可以像在Laravel 4文档中所描述的那样使用所有Blade功能:https://laravel.net.cn/docs/templates#blade-templating