krystal-sf/common

Common files for Krystal Symfony Projects

Maintainers

Package info

gitlab.com/krystal-sf/common

Homepage

Issues

Type:symfony-bundle

pkg:composer/krystal-sf/common

Transparency log

Statistics

Installs: 1 894

Dependents: 1

Suggesters: 0

Stars: 0

0.1.0 2025-09-07 16:23 UTC

This package is auto-updated.

Last update: 2026-08-05 23:10:45 UTC


README

Latest Stable Version License PHP Version Symfony Version

Common files and utilities for Krystal Symfony Projects.

Overview

This package provides essential components, utilities, and base classes that are shared across Krystal Symfony projects. It serves as a foundation for building consistent and maintainable Symfony applications.

Requirements

  • PHP 8.1+
  • Symfony 6.4 or 7.0
  • Various Symfony components (see composer.json for details)

Installation

composer require krystal-sf/common

Features

This package includes:

  • Common utilities and helper functions
  • Base classes for controllers, services, and other components
  • Shared Twig extensions and form types
  • Security-related utilities
  • HTTP client extensions

Theme Layouts Publishing

Any bundle extending AbstractKrystalBundle (via GenericBundleExtension) that exposes a Resources/views/layouts/ directory gets it automatically published in the main Twig namespace, before the application templates/ directory. No configuration needed — the convention is the directory itself.

This is how Krystal themes provide the application layout: a theme ships Resources/views/layouts/krystal.html.twig, and the application simply extends it:

{# templates/base.html.twig #}
{% extends "krystal.html.twig" %}

The application keeps control: it can extend any published layout by name, or define its own templates under other names (published layouts only shadow files with the same name).

Priority & Collisions

Twig resolves the first matching path. Published layouts are ordered by bundle registration: the last bundle registered in bundles.php wins when two bundles publish a layout with the same file name. This is deterministic — and it is also the child-theme mechanism: a theme registered after another can override only the layouts it redefines and inherit the rest.

Convention for Krystal V1: activate a single full theme at a time. When stacking themes on purpose, register the overriding theme last, and check the effective resolution order with:

bin/console debug:twig

Dependencies

The package requires the following Symfony components:

  • symfony/http-kernel
  • symfony/http-client
  • symfony/twig-bundle
  • symfony/security-bundle
  • symfony/runtime
  • symfony/dotenv
  • symfony/form
  • symfony/intl
  • symfony/validator
  • symfony/translation
  • symfony/flex

Additionally, it requires:

  • webmozart/assert

Development

For development, the package uses:

  • badpixxel/php-sdk
  • symfony/debug-pack

License

This package is released under the MIT License. See the LICENSE file for more details.

Author

Developed by BadPixxel.