Bootstrap theme switch for Symfony
MIT License
Add my recipe repository endpoint in your project's composer.json
as described in the
Symfony documentation.
{
"extra": {
"symfony": {
"endpoint": [
"https://api.github.com/repos/neuralglitch/symfony-recipes/contents/index.json",
"flex://defaults"
]
}
}
}
[!WARNING] If you don't, Composer will not use the Symfony Flex recipe for this bundle and you will need to follow these manual installation instructions.
[!TIP] The
extra.symfony
key will most probably already exist in yourcomposer.json
. In that case, add theendpoint
key to the existingextra.symfony
entry.
composer require neuralglitch/bootstrap-theme-switch
Execute the appropriate commands to build the frontend, if necessary.
templates/base.html.twig
<html
data-bs-theme="{{ app.session.get('_theme', 'light') }}"
data-system-theme="{{ app.session.get('_is_system_theme', '0') }}">
i.e. templates/partials/footer.html.twig
...
{% include '@BootstrapThemeSwitch/button.html.twig' %}
...
or
...
{% include '@BootstrapThemeSwitch/select.html.twig' %}
...
If that's not enough, refer to the advanced usage instructions.
[!WARNING] Wiithout the Symfony Flex recipe, Composer will not completely remove the bundle and you will need to follow these manual removal instructions.
composer remove neuralglitch/bootstrap-theme-switch
Execute the appropriate commands to build the frontend, if necessary.
Copyright (c) neuralglit.ch