krystal-sf / common
Common files for Krystal Symfony Projects
Package info
Type:symfony-bundle
pkg:composer/krystal-sf/common
Requires
- php: ^8.1
- symfony/dotenv: ^6.4|^7.0
- symfony/flex: ^1.0|^2.0
- symfony/form: ^6.4|^7.0
- symfony/http-client: ^6.4|^7.0
- symfony/http-kernel: ^6.4|^7.0
- symfony/intl: ^6.4|^7.0
- symfony/runtime: ^6.4|^7.0
- symfony/security-bundle: ^6.4|^7.0
- symfony/translation: ^6.4|^7.0
- symfony/twig-bundle: ^6.4|^7.0
- symfony/validator: ^6.4|^7.0
- webmozart/assert: ^1.0
Requires (Dev)
- badpixxel/php-sdk: ^2.0|^3.0
- symfony/debug-pack: ^1.0
README
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.