Download the PHP package symkit/settings-bundle without Composer
On this page you can find all versions of the php package symkit/settings-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download symkit/settings-bundle
More information about symkit/settings-bundle
Files in symkit/settings-bundle
Package settings-bundle
Short Description A Symfony bundle for managing application-wide settings with a sectioned UI, automatic cache invalidation, and WebManifest generation.
License MIT
Informations about the package settings-bundle
Settings Bundle
A Symfony bundle for managing application-wide settings with a sectioned UI, automatic cache invalidation, and WebManifest generation. Features are activable per block (admin, webmanifest, Twig, metadata provider). Entity and repository are configurable so you can use your own classes.
Requirements
- PHP 8.2+
- Symfony 7.x or 8.x
- symkit/media-bundle (for Media fields and entity relations)
- symkit/form-bundle, symkit/crud-bundle, symkit/metadata-bundle, symkit/menu-bundle (for the admin UI)
Features
- Sectioned Form: Organize settings into logical groups (General, Logos, Social, Icons) via
FormSectionType(symkit/form-bundle). - Singleton Management: Single settings entity with cache and invalidation on update.
- WebManifest: Service to generate
site.webmanifestdata; route can be enabled/disabled. - Twig: Global
settingsvariable andapp_settings()function (optional). - Metadata: Optional
SiteInfoProviderfor symkit/metadata-bundle. - Translations: Domain
SymkitSettingsBundlewith EN and FR provided.
Installation
-
Install the bundle:
-
Register the bundle in
config/bundles.php: -
Configure Doctrine mapping in
config/packages/doctrine.yaml(adjustdir/prefixif using a custom entity): -
Create
config/packages/symkit_settings.yaml: -
Routes: Import only the route files for features you enable.
-
If
admin.enabledis true, inconfig/routes.yaml: - If
webmanifest.enabledis true:
-
- Metadata (optional)
Ifmetadata_provider.enabledis true, set your app’s metadata bundle to use the settings provider, e.g. inconfig/packages/symkit_metadata.yaml:
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
cache_expires_after |
int | 86400 |
Cache TTL in seconds. |
admin.enabled |
bool | true |
Register admin controller and admin routes. |
admin.route_prefix |
string | admin |
URL prefix for admin (e.g. /admin/settings). |
webmanifest.enabled |
bool | true |
Register webmanifest controller and route. |
twig.enabled |
bool | true |
Register Twig extension (settings, app_settings()). |
metadata_provider.enabled |
bool | true |
Register SiteInfoProvider for symkit/metadata-bundle. |
doctrine.entity |
string | Symkit\SettingsBundle\Entity\Settings |
FQCN of settings entity. |
doctrine.repository |
string | Symkit\SettingsBundle\Repository\SettingsRepository |
FQCN of settings repository. |
Disabling a feature (e.g. admin.enabled: false) means the corresponding services and routes are not registered; do not import the related route file in that case.
Custom entity and repository
Your entity must implement Symkit\SettingsBundle\Contract\SettingsInterface. Your repository must implement Symkit\SettingsBundle\Contract\SettingsRepositoryInterface and provide a constructor compatible with the bundle (e.g. ManagerRegistry + string $entityClass for a Doctrine repository).
Example:
Map your entity in Doctrine and import only the admin route if you use the bundled admin UI.
Usage
Twig (when twig.enabled is true)
PHP
Inject the manager interface:
WebManifest
When webmanifest.enabled is true and the route is imported, the manifest is served at /site.webmanifest.
Translations
The bundle uses the domain SymkitSettingsBundle and ships with translations/SymkitSettingsBundle.en.xlf and SymkitSettingsBundle.fr.xlf. You can override or add messages in your app’s translations/ directory with the same domain.
Contributing
Run make quality before committing.
License
MIT.
All versions of settings-bundle with dependencies
symfony/framework-bundle Version ^7.0 || ^8.0
symkit/crud-bundle Version ~0.0.1
symkit/form-bundle Version ~0.0.1
symkit/media-bundle Version ~0.0.1
symkit/metadata-bundle Version ~0.0.1
symkit/menu-bundle Version ~0.0.1