Skip to content

Latest commit

 

History

History
108 lines (74 loc) · 3.36 KB

File metadata and controls

108 lines (74 loc) · 3.36 KB

Installation

This guide covers installing Ui Kit Bundle in a Symfony application.

Table of contents

Requirements

  • PHP >=8.1 (<8.6). Symfony 8.0 and 8.1 require PHP 8.4+.
  • Symfony ^6.0 || ^7.0 || ^8.0 — CI mandatory minors: 7.4, 8.0, 8.1.
  • Twig 3.8+ (via symfony/twig-bundle).

PHP and Symfony matrix

Symfony Minimum PHP (bundle) Minimum PHP (Symfony)
6.x / 7.0–7.3 8.1 as per Symfony
7.4 8.2 8.2
8.0 8.4 8.4
8.1 8.4 8.4

Install with Composer

composer require nowo-tech/ui-kit-bundle

Packagist: nowo-tech/ui-kit-bundle.

Register the bundle

With Symfony Flex

The recipe stub under .symfony/recipe/nowo-tech/ui-kit-bundle/1.0/ registers the bundle and copies config/packages/nowo_ui_kit.yaml. There are no routes (Ui Kit is Twig/CSS/JS only). See RECIPE.md. Until the recipe is published on symfony/recipes-contrib, register manually as below.

Manual registration

  1. Register the bundle in config/bundles.php:
<?php

return [
    // ...
    Nowo\UiKitBundle\NowoUiKitBundle::class => ['all' => true],
];
  1. Create configuration config/packages/nowo_ui_kit.yaml:
nowo_ui_kit:
    css_framework: bootstrap5
    icon_set: bootstrap-icons
    row_actions_display: icon

See Configuration for all enum values.

Assets

php bin/console assets:install

This publishes src/Resources/public to public/bundles/nowouikit/ (css/nowo-ui.css, js/nowo-ui-modal.js, js/nowo-ui-shell.js). Templates load them via the nowo_ui_kit asset package:

<link rel="stylesheet" href="{{ asset('css/nowo-ui.css', 'nowo_ui_kit') }}">
<script defer src="{{ asset('js/nowo-ui-modal.js', 'nowo_ui_kit') }}"></script>
<script defer src="{{ asset('js/nowo-ui-shell.js', 'nowo_ui_kit') }}"></script>

AssetMapper

The bundle registers the nowo_ui_kit asset package (base_path: /bundles/nowouikit). Run assets:install once so public files are published. Do not hard-code /bundles/nowouikit/... paths in host layouts.

Contributors rebuild frontend assets with:

make assets

Twig Extra Bundle (REQ-TWIG-004)

This package ships Twig templates. Host applications must install and enable Twig Extra:

composer require twig/extra-bundle twig/string-extra

Register Twig\Extra\TwigExtraBundle\TwigExtraBundle in config/bundles.php (Flex usually does this). Demos already include the same stack. The package release-check runs make check-twig-extra to guard this contract.

Next steps