rezon73 / laravel-blade
使用简单而强大的 Laravel Blade 模板引擎作为独立组件。
v1.0
2022-11-08 09:28 UTC
Requires
- php: >=8.0
- illuminate/events: ~9.38
- illuminate/view: ~9.38
This package is not auto-updated.
Last update: 2024-09-26 06:15:21 UTC
README
安装(Blade Laravel 5.1)
可以通过在项目的 composer.json 中要求 "philo/laravel-blade": "3.*" 包来通过 Composer 安装此包。
{ "require": { "philo/laravel-blade": "3.*" } }
安装(Blade Laravel 4)
可以通过在项目的 composer.json 中要求 "philo/laravel-blade": "2.*" 包来通过 Composer 安装此包。
{ "require": { "philo/laravel-blade": "2.*" } }
用法
<?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 Philo\Blade\Blade; $views = __DIR__ . '/views'; $cache = __DIR__ . '/cache'; $blade = new Blade($views, $cache); echo $blade->view()->make('hello')->render();
您可以使用 Laravel 5.1 文档中描述的所有 blade 功能:[Laravel 5.1 文档](https://laravel.net.cn/docs/5.1/blade)