heimrichhannot/contao-frontend-framework-bundle

此插件允许您在主题中选择前端框架。

0.1.0 2023-12-04 15:06 UTC

This package is auto-updated.

Last update: 2024-09-04 16:49:17 UTC


README

此插件允许您在主题中选择前端框架。此选项可用于插件和模板以适应这些特定框架。

安装

  1. 使用composer或contao管理器安装插件,然后更新数据库。

     composer require heimrichhannot/contao-frontend-framework-bundle
    

使用方法

只需在主题设置中选择前端框架。可能其他插件将为所选框架添加额外的设置。默认情况下,此扩展除了框架选择外没有内置功能。

screenshot.png

在您的插件中使用

使用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
            }
        }
    }
}