northrook/symfony-components-bundle

A component library for Symfony, using Latte.

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

This package is auto-updated.

Last update: 2024-11-17 09:11:19 UTC


README

A collection of reusable components for Symfony, using Latte.

Installation

Note

This bundle is intended to be used by the Northrook Symfony Core Bundle.

Stand-alone usage is not supported at this time.

Install the bundle stand-alone with Composer:

composer require northrook/symfony-components-bundle

Usage

The bundle parses each .latte template file when rendering, and replaces components with parsed HTML and PHP code, ready to be rendered by the Symfony framework.

Example for a field component:

// 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>

Contributing

This bundle is not currently accepting contributions, and is subject to change.

Feel free to reach out to us if you have any questions or suggestions.