nhzex/think-blade
Think-Blade 7.x
thinkphp 6.1, 8.0 blade 视图渲染驱动
blade版本: v9.52.15
Installation
composer require nhzex/think-blade
view.php
<?php
[
// 模板引擎类型
'type' => 'blade',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name'=> 'view',
// 模板后缀
'view_suffix' => 'blade.php',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 编译缓存
'tpl_cache' => true,
];
统一扩展注册(7.x 暂不支持)
<?php
$register = app()->make(\HZEX\Blade\Register::class);
$register->directive('strlen', function ($parameter) {
return "<?php echo strlen($parameter) ?>";
});
$register->if('auth', function ($parameter) {
return true;
});
auth 支持 (自行实现并绑定到以下命名)
- app->bind('auth', concrete::class)
- auth->check(): bool
- auth->guest(): bool
- app->bind('auth.gate', concrete::class)
- auth->check($abilities, $arguments): bool
- auth->denies($abilities, $arguments): bool
- auth->any($abilities, $arguments): bool
代码引用
Related Packages
philo/laravel-blade
Use the simple and yet powerful Laravel Blade templating engine as a standalone...
689,955
355
wapmorgan/morphos-blade
Adds @plural, @name, @numeral, @ordinal and @money tags to Blade for Russian plu...
90,510
33
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v7.0.0 | ^8.0 | Apache-2.0 | |
| v5.1.0 | ^7.2| | Apache-2.0 | |
| v5.0.2 | ^7.2| | Apache-2.0 | |
| v5.0.1 | ^7.2| | Apache-2.0 | |
| v5.0.0 | ^7.2 | Apache-2.0 | |
| v4.4.3 | >=7.1 | Apache-2.0 | |
| v4.4.2 | >=7.1 | Apache-2.0 | |
| v4.4.1 | >=7.1 | Apache-2.0 | |
| v4.4.0 | >=7.1 | Apache-2.0 | |
| v4.3.1 | >=7.1 | Apache-2.0 | |
| v4.3.0 | >=7.1 | Apache-2.0 | |
| v4.2.0 | >=7.1 | Apache-2.0 | |
| v4.1.1 | >=7.1 | Apache-2.0 | |
| v4.1.0 | >=7.1 | Apache-2.0 | |
| v4.0.2 | >=7.1 | Apache-2.0 | |
| v4.0.1 | >=7.1 | Apache-2.0 | |
| 2.0.2 | >=7.1 | Apache-2.0 | |
| 1.0.2 | >=7.1 | Apache-2.0 | |
| 1.0.1 | >=7.1 | Apache-2.0 | |
| 1.0.0 | >=7.1 | Apache-2.0 |
Pre-releases (4)
| Version | Released | PHP | License |
|---|---|---|---|
| v7.0.0-beta.4 | ^8.0 | Apache-2.0 | |
| v7.0.0-beta.3 | ^8.0 | Apache-2.0 | |
| v7.0.0-beta.2 | ^8.0 | Apache-2.0 | |
| v7.0.0-beta.1 | ^8.0 | Apache-2.0 |