heimrichhannot / contao-frontend-framework-bundle
此插件允许您在主题中选择前端框架。
0.1.0
2023-12-04 15:06 UTC
Requires
- php: ^8.0
- contao/core-bundle: ^4.13 || ^5.0
- heimrichhannot/contao-utils-bundle: ^2.232 || ^3.0.0-beta
README
此插件允许您在主题中选择前端框架。此选项可用于插件和模板以适应这些特定框架。
安装
-
使用composer或contao管理器安装插件,然后更新数据库。
composer require heimrichhannot/contao-frontend-framework-bundle
使用方法
只需在主题设置中选择前端框架。可能其他插件将为所选框架添加额外的设置。默认情况下,此扩展除了框架选择外没有内置功能。
在您的插件中使用
使用FrontendFrameworkHelper
获取所选框架。
use HeimrichHannot\FrontendFrameworkBundle\Helper\FrontendFrameworkHelper; class CustomController { private FrontendFrameworkHelper $frontendFrameworkHelper; public function myCustomAction() { if ('bootstrap4' === $this->frontendFrameworkHelper->currentFramework()) { $theme = $this->frontendFrameworkHelper->currentTheme(); if (true === $theme->custonControlsBs4) { // do something } } } }