e2es/blade
Composer 安装命令:
composer require e2es/blade
包简介
E2E Studios PHP Framework adaptation of leafsphp/blade package
README 文档
README
Blade
The standalone version of Laravel's Blade templating engine for use outside of Laravel.
This package is based on leafsphp/blade.
Installation
Install using composer:
composer require e2es/blade
Usage
Create a Blade instance by passing it the folder(s) where your view files are located, and a cache folder. Render a template by calling the make method. More information about the Blade templating engine can be found on https://laravel.com/docs/9.x/blade.
use EndToEnd\Blade;
$blade = new Blade('app/views', 'app/views/cache');
You can also initialise it globally and point to template directories later.
$blade = new Blade;
// somewhere, maybe in a different file
$blade->configure("app/views", "app/views/cache");
echo $blade->make('index', ['name' => 'Michael Darko'])->render();
Alternatively you can use the shorthand method render:
echo $blade->render('index', ['name' => 'Michael Darko']);
We can have this as our template index.blade.php
<!Doctype html>
<html>
<head>
<title>{{ $name }}</title>
</head>
<body>
<div class="container">{{ $name }}</div>
</body>
</html>
You can also extend Blade using the directive() function:
$blade->directive('datetime', function ($expression) {
return "<?php echo with({$expression})->format('F d, Y g:i a'); ?>";
});
Which allows you to use the following in your blade template:
Current date: @datetime($date)
The Blade instances passes all methods to the internal view factory. So methods such as exists, file, share, composer and creator are available as well. Check out the original documentation for more information.
e2es/blade 适用场景与选型建议
e2es/blade 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 556 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「template」 「view」 「laravel」 「render」 「blade」 「e2e」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 e2es/blade 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 e2es/blade 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 e2es/blade 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shoot aims to make providing data to your templates more manageable
Illuminate View for Morningmedley.
Blade template for Kirby
Simple ASCII output of array data
View5 is a version of Blade Templates for the Mvc5 Framework
Yii2 prettyPhoto image galary widget uses Lightbox view control jquery.prettyphoto.js
统计信息
- 总下载量: 556
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-11