Download the PHP package basilicom/path-formatter-bundle without Composer
On this page you can find all versions of the php package basilicom/path-formatter-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download basilicom/path-formatter-bundle
More information about basilicom/path-formatter-bundle
Files in basilicom/path-formatter-bundle
Package path-formatter-bundle
Short Description This bundle provides path formatter pattern configuration for Pimcore DataObjects in multi-relation.
License GPL-3.0-or-later
Homepage https://basilicom.de
Informations about the package path-formatter-bundle
Basilicom Extended Path Formatter Bundle for Pimcore
Usecase / Summary
If you want to display specific information of a DataObject when it's listed in a relation-field (Many-to-Many, Many-to-One, Advanced Many-to-Many, etc.), you can use this bundle to easily configure a display pattern.
Instead of creating a new PathFormatter PHP class for every specific display requirement (e.g., showing the name, price, and currency of a product), you can simply define patterns in your configuration.
You can also define specific pattern overwrites for a class when it is referenced in a specific field of another class:
While the product will be formatted like Sneakers 19.99EUR in most relation-fields, the products field in the ProductList class will show them like #13 Sneakers.
Version information
| Bundle Version | PHP | Pimcore |
|---|---|---|
| ^1.0 | ^7.3 | ^6.0 |
| ^2.0 | ^8.0 | ^10.0 |
| ^3.0 | ^8.1 | ^11.0 |
Installation
-
Install the bundle using composer:
- Enable the bundle:
- Pimcore >= 10: The bundle should be automatically registered. If not, add it to
config/bundles.php. - Pimcore < 10: Add the following to
AppKernel::registerBundlesToCollection():
- Pimcore >= 10: The bundle should be automatically registered. If not, add it to
Configuration
- Create a configuration file (e.g.,
config/packages/basilicom_path_formatter.yaml). - Configure your patterns using the full qualified class names as keys.
Basic Configuration
Use curly brackets {} to reference class properties. Any property accessible via a public getter (e.g., {name} calls getName()) can be used.
Nested Properties
The bundle supports nested property access using dot notation. For example, if a Product has a Category, and you want to show the category name:
Note: This will call $product->getCategory()->getName().
Contextual Pattern Overwrites
You can override patterns based on the context (the parent object and the specific field).
Formatting Documents and Assets
The formatter is not limited to DataObjects; it also works for Assets and Documents.
Additional Features
Inheritance in DataObjects
By default, inherited values are used when resolving placeholders. You can disable this globally:
Asset Previews
If a referenced property resolves to a Pimcore\Model\Asset\Image, the bundle automatically renders a small preview thumbnail in the relation list.
If the target element itself is an Asset\Image, a preview is also prepended to the pattern.
Usage in Pimcore Admin
To apply the formatter to a field:
- Open your Class Definition.
- Select a relation field (e.g., Many-to-Many Relation).
- In the Formatter input field, enter the service ID:
@Basilicom\PathFormatterBundle\DependencyInjection\BasilicomPathFormatter
Author: Alexander Heidrich (Basilicom GmbH)
License: GPL v3