heimrichhannot / contao-config-element-type-bundle
Contains interface and common config type elements for bundle with config type support
Installs: 2 809
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 1
Type:contao-bundle
Requires
- contao/core-bundle: ^4.4
This package is auto-updated.
Last update: 2024-11-02 08:30:19 UTC
README
This bundle contains a generic interface, an generic data class and concrete independent implementations for config element types.
Config element types are designed to specify things that can occur multiple times on the same item (e.g. many fields of the same type) and used in List Bundle and Reader Bundle.
Setup
This bundle is a dependency bundle and has no usage as standalone package. If you want to create an extension that uses this bundle, add it to your composer.json file.
Install with composer:
composer require heimrichhannot/contao-config-element-type-bundle
Usage
The main content of this bundle is the ConfigElementTypeInterface. Example implementations can be found within the bundled config element types.
The ConfigElementTypeInterface has three methods:
public static function getType(): string
- Returns an alias for identifying the content element type, typically used in database or translation context.public function getPalette(string $prependPalette, string $appendPalette): string
- Return the contao dca palette. The paremeters can be used if you have default palette fields to prepend or append to the palette.public function applyConfiguration(ConfigElementData $configElementData): ConfigElementResult
- Here the config element type logic is applied. Typically a raw field value is processed and a formatted field value returned.
Real life usage examples can be found in Reader Bundle and List Bundle.