jacktaken/laravel-zc-liquid
Composer 安装命令:
composer require jacktaken/laravel-zc-liquid
包简介
Liquid template engine for Laravel
README 文档
README
Liquid is a PHP port of the Liquid template engine for Ruby, which was written by Tobias Lutke. Although there are many other templating engines for PHP, including Smarty (from which Liquid was partially inspired), Liquid had some advantages that made porting worthwhile:
- Readable and human friendly syntax, that is usable in any type of document, not just html, without need for escaping.
- Quick and easy to use and maintain.
- 100% secure, no possibility of embedding PHP code.
- Clean OO design, rather than the mix of OO and procedural found in other templating engines.
- Seperate compiling and rendering stages for improved performance.
- 100% Markup compatibility with a Ruby templating engine, making templates usable for either.
- Unit tested: Liquid is fully unit-tested. The library is stable and ready to be used in large projects.
Why Liquid?
Why another templating library?
Liquid was written to meet three templating library requirements: good performance, easy to extend, and simply to use.
Installing
You can install this lib via composer:
composer require simexis/laravel-liquid
Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider
Laravel 5.5+:
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
Liquid\LiquidServiceProvider::class,
If you want to use the facade to compiler:
'Liquid' => Liquid\Facade::class,
php artisan vendor:publish --provider="Liquid\LiquidServiceProvider"
Example template
{% if products %}
<ul id="products">
{% for product in products %}
<li>
<h2>{{ product.name }}</h2>
Only {{ product.price | price }}
{{ product.description | prettyprint | paragraph }}
{{ 'it rocks!' | paragraph }}
</li>
{% endfor %}
</ul>
{% endif %}
How to use Liquid
class HomeController extends Comtroller {
public function index()
{
$products = Products::all();
return view('home', [
'products' => $products
]);
}
}
To find more examples at the original Ruby implementation repository's wiki page.
Requirements
- PHP 5.3+
- laravel/framework 5.3+
Issues
Have a bug? Please create an issue here on GitHub!
jacktaken/laravel-zc-liquid 适用场景与选型建议
jacktaken/laravel-zc-liquid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 12 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「template」 「liquid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 jacktaken/laravel-zc-liquid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jacktaken/laravel-zc-liquid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 jacktaken/laravel-zc-liquid 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Liquid template engine for Laravel
Liquid template engine for themes.
Liquid template engine for Laravel
Simple ASCII output of array data
Count words, get reading times, and convert text to list items.
E2E Studios PHP Framework adaptation of leafsphp/blade package
统计信息
- 总下载量: 28
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-12-21