northrook / symfony-components-bundle
一个基于 Latte 的 Symfony 组件库。
dev-main
2024-05-17 08:12 UTC
Requires
- php: >=8.2
- northrook/core: dev-main
- northrook/elements: dev-main
- northrook/logger: dev-main
- northrook/types: dev-main
- symfony/config: ^7.0
- symfony/dependency-injection: ^7.0
- symfony/deprecation-contracts: ^3.0
- symfony/http-kernel: ^7.0
Requires (Dev)
- northrook/symfony-core-bundle: dev-main
- northrook/symfony-latte-bundle: dev-main
- northrook/symfony-stylesheets-bundle: dev-main
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-09-17 08:50:04 UTC
README
一个用于 Symfony 的可重用组件集合,使用 Latte。
安装
注意
此包旨在与Northrook Symfony Core Bundle 一起使用。
目前不支持独立使用。
使用 Composer 独立安装此包
composer require northrook/symfony-components-bundle
用法
该包在渲染时解析每个 .latte
模板文件,并用解析后的 HTML 和 PHP 代码替换组件,使其能够由 Symfony 框架渲染。
field
组件的示例
// in template.latte <field:email name="email" label="Email" required autofocus autocomplete="username"/> // output in cached template <field id="email-input-component" class="email field"> <div class="label"> <label for="email"> Email </label> </div> <div class="input"> <input id="email" type="email" name="email" autocomplete="username"> </div> </field>
贡献
此包目前不接受贡献,并且可能会发生变化。
如果您有任何问题或建议,请随时与我们联系。