Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: #94692 - Registering Icons via Service Container #4423

Open
simonschaufi opened this issue Oct 30, 2024 · 1 comment · Fixed by #2830
Open

Feature: #94692 - Registering Icons via Service Container #4423

simonschaufi opened this issue Oct 30, 2024 · 1 comment · Fixed by #2830

Comments

@simonschaufi
Copy link
Collaborator

Feature: #94692 - Registering Icons via Service Container

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.4/Feature-94692-RegisteringIconsViaServiceContainer.html

Feature: #94692 - Registering Icons via Service Container

See 94692

Description

Extensions can now register their custom icons via a configuration file
placed in Configuration/Icons.php of their extension directory, e.g.
typo3conf/ext/my_extension/Configuration/Icons.php.

Each file needs to return a flat PHP configuration array, with custom
options used for the IconRegistry to register a new icon.

Example:

<?php
return [
    'myicon' => [
        'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
        'source' => 'EXT:my_extension/Resources/Public/Icons/myicon.svg'
    ],
    'anothericon' => [
        'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
        'source' => 'EXT:my_extension/Resources/Public/Icons/anothericon.svg'
    ],
    ...
];

Impact

Using the new approach improves the loading speed of every request as
the registration can be handled at once and cached during warmup of the
core caches.

In addition, extension authors' ext_localconf.php files are
drastically reduced, as extension authors have a better overview and a
better separation of concerns when registering custom functionality.

PHP-API, ext:core

@simonschaufi
Copy link
Collaborator Author

Resolved with #2830

@simonschaufi simonschaufi linked a pull request Oct 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant