northrook/symfony-components-bundle

一个基于 Latte 的 Symfony 组件库。

安装: 45

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 0

开放问题: 0

类型:symfony-bundle

dev-main 2024-05-17 08:12 UTC

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>

贡献

此包目前不接受贡献,并且可能会发生变化。

如果您有任何问题或建议,请随时与我们联系。