PHP code example of eliashaeussler / typo3-config-objects
1. Go to this page and download the library: Download eliashaeussler/typo3-config-objects library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
eliashaeussler / typo3-config-objects example snippets
// Configuration/Icons.php
use EliasHaeussler\Typo3ConfigObjects;
return Typo3ConfigObjects\Configuration\IconConfiguration::create()
// Add a list of icons to configure
->add(
Typo3ConfigObjects\ValueObject\Icon::create('tx-example-my-icon')
->useSvgIconProvider('EXT:example/Resources/Public/Icons/my-icon.svg'),
Typo3ConfigObjects\ValueObject\Icon::create('tx-example-my-second-icon')
->useBitmapIconProvider('EXT:example/Resources/Public/Icons/my-second-icon.jpg')
)
// You can also use deprecated icons
->add(
Typo3ConfigObjects\ValueObject\Icon::create('tx-example-my-legacy-icon')
->useSvgIconProvider('EXT:example/Resources/Public/Icons/my-legacy-icon.svg')
->setDeprecated(
new Typo3ConfigObjects\ValueObject\DeprecatedIcon(
since: 'TYPO3 v12',
until: 'TYPO3 v13',
replacement: 'tx-example-my-new-icon',
),
)
)
// You can also use custom icon providers and custom options
->add(
Typo3ConfigObjects\ValueObject\Icon::create('tx-example-my-new-icon')
->useCustomIconProvider(\Vendor\Example\Imaging\MyCustomIconProvider::class)
->addOption('renderer', \Vendor\Example\Renderer\MyCustomIconRenderer::class)
)
// Don't forget to return an array representation (TYPO3 expects an array to be returned)
->toArray();
// Configuration/RequestMiddlewares.php
use EliasHaeussler\Typo3ConfigObjects;
return Typo3ConfigObjects\Configuration\MiddlewareConfiguration::create()
// Add a list of middlewares
->addToBackendStack(
Typo3ConfigObjects\ValueObject\RequestMiddleware::create('vendor/extension/my-middleware')
->setTarget(\Vendor\Example\Middleware\MyMiddleware::class),
Typo3ConfigObjects\ValueObject\RequestMiddleware::create('vendor/extension/my-other-middleware')
->setTarget(\Vendor\Example\Middleware\MyOtherMiddleware::class)
->before('vendor/extension/my-middleware')
->after('typo3/cms-backend/authentication')
)
// You can also disable existing middlewares
->addToFrontendStack(
Typo3ConfigObjects\ValueObject\RequestMiddleware::create('typo3/cms-redirects/redirecthandler')
->disable()
)
// Don't forget to return an array representation (TYPO3 expects an array to be returned)
->toArray();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.