tecnoready/sf-adminlte3-bundle

包含AdminLTE 3模板的symfony 4捆绑包

dev-master 2021-11-02 17:11 UTC

This package is auto-updated.

Last update: 2024-08-29 05:09:32 UTC


README

AdminLTE 3模板的symfony 4.x

1) 更新composer.json中的"scripts"部分

"scripts": {
        "local-scripts-post": [
            "Tecnoready\\SFAdminLTE3Bundle\\Service\\ScriptHandler::postInstall"
        ],
        "post-install-cmd": [
            "@local-scripts-post"
        ],
        "post-update-cmd": [
            "@local-scripts-post"
        ]
    }

2) 安装包

php -d memory_limit=-1 /usr/local/bin/composer require tecnoready/sf-adminlte3-bundle

3) 配置捆绑包

sf_admin_lte3:
    menu_builder: App\Service\MenuBuilder
    app_name: Mi aplicacion
  • 创建类Menu: App\Service\MenuBuilder应继承自Tecnoready\SFAdminLTE3Bundle\Service\BaseMenuBuilder

  • 编辑您的webpack.config.js并添加以下行

    const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
    
    Encore
    .addEntry('dependencies', './assets/js/dependencies.js')
    .copyFiles([
      {from: './node_modules/ckeditor/', to: 'ckeditor/[path][name].[ext]', pattern: /\.(js|css)$/, includeSubdirectories: false},
      {from: './node_modules/ckeditor/adapters', to: 'ckeditor/adapters/[path][name].[ext]'},
      {from: './node_modules/ckeditor/lang', to: 'ckeditor/lang/[path][name].[ext]'},
      {from: './node_modules/ckeditor/plugins', to: 'ckeditor/plugins/[path][name].[ext]'},
      {from: './node_modules/ckeditor/skins', to: 'ckeditor/skins/[path][name].[ext]'}
    ])
    .autoProvideVariables({
        moment: "moment"
    })
    .addPlugin(new MomentLocalesPlugin({
        localesToKeep: ['es'],
    }));
    
  • 将主题添加到twig.yaml: twig: form_themes: - '@SFAdminLTE3/default/theme.html.twig' - '@TetranzSelect2Entity/Form/fields.html.twig' - '@FOSCKEditor/Form/ckeditor_widget.html.twig'