Installation

Install the bundle with Composer, let Symfony Flex register it, then start extending the AdminLTE layout. Assets work from the CDN with zero config; AssetMapper is the production path.

1. Require the package

composer require colorlibhq/adminlte-symfony

2. Bundle registration

With Symfony Flex the bundle is registered automatically. If you are not using Flex, add it manually to config/bundles.php:

<?php

return [
    // ...
    ColorlibHQ\AdminLteBundle\AdminLteBundle::class => ['all' => true],
];

The bundle depends on symfony/ux-twig-component and symfony/stimulus-bundle (pulled in automatically) so that the <twig:Adminlte:*> components and the command palette controller resolve.

3. Minimum versions

DependencyConstraint
php>=8.4
symfony/framework-bundle^8.1
symfony/twig-bundle^8.1
symfony/asset-mapper^8.1
symfony/ux-twig-component^2.30
twig/twig^3.21

4. Assets — CDN (default)

The base layout's stylesheets and javascripts blocks ship with jsDelivr CDN links for AdminLTE 4, Bootstrap 5.3 and Bootstrap Icons, so the bundle renders correctly with no further setup:

{# already emitted by @AdminLte/layout.html.twig #}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@4.0.2/dist/css/adminlte.min.css">
<script src="https://cdn.jsdelivr.net/npm/admin-lte@4.0.2/dist/js/adminlte.min.js"></script>

5. Assets — AssetMapper (production)

For production, serve the assets locally instead of from the CDN. Pin the packages into your importmap:

php bin/console importmap:require bootstrap admin-lte bootstrap-icons/font/bootstrap-icons.min.css

Then import the bundle's behaviour entrypoint from your app:

// assets/app.js
import '@colorlibhq/adminlte-symfony/adminlte.js'; // Bootstrap + AdminLTE behaviour

Finally, override the layout's stylesheets/javascripts blocks in your base template to emit {{ importmap('app') }} instead of the CDN tags. See Deployment for the full production build.

The bundle exposes its assets to AssetMapper under the @colorlibhq/adminlte-symfony namespace only when AssetMapper is installed. Without it, the inline color-mode script and CDN layout still work — nothing breaks.

Next step

Create your configuration file — see Configuration.


AdminLTE 4 · Symfony port Edit on GitHub