ics / libs-bundle
symfony 的一个新套餐
0.0.1
2022-02-03 14:40 UTC
Requires
- doctrine/orm: ^2.8
- ics/navigation-bundle: ^0
- ics/ssi-bundle: ^0
- symfony/config: ^5
- symfony/dependency-injection: ^5
- symfony/form: ^5
- symfony/framework-bundle: ^5
- symfony/routing: ^5
- symfony/security-bundle: ^5.4
- twig/twig: ^3.3
This package is auto-updated.
Last update: 2024-09-29 05:50:07 UTC
README
用于添加库和主题的 bootstrap 套餐
包含的库
- Jquery
3.6.0
- Bootstrat
5.0.2
- Bootswatch 主题
5.0.2
- Font Awesome 免费图标
5.15.4
安装
确保已全局安装 Composer,如 Composer 文档中的 安装章节 所述。
使用 Symfony Flex 的应用程序
打开命令行,进入您的项目目录并执行
composer require ics/libs-bundle
不使用 Symfony Flex 的应用程序
步骤 1: 下载套餐
打开命令行,进入您的项目目录并执行以下命令以下载此套餐的最新稳定版本
$ composer require ics/libs-bundle
步骤 2: 启用套餐
然后,通过将其添加到项目的 config/bundles.php
文件中注册的套餐列表中来启用套餐
// config/bundles.php return [ // ... ICS\LibsBundle\LibsBundle::class => ['all' => true], ];
步骤 3: 路由
Libs 需要 config/routes.yaml
中的路由来保存用户主题选择
# config/routes.yaml libs_bundle: resource: "@LibsBundle/config/routes.yaml" prefix: /libs
主题选择已保存在
user.profile.parameters
(数组)中,与 ics/ssi-bundle 兼容
步骤 4: 在模板中添加 libs
{# templates/base.html.twig #}
{{ renderLibs() }}
配置
# config/packages/libs.yaml libs: # Use CDN if false libs use local files (default: true) cdn: true # Active bootstrap (default: true) bootstrap: true # Active jQuery (default: true) jquery: true # Active Font Awesome Free Icons (default: true) fontawesome: true # List of Bootswatch enabled themes (default all themes are activated) bootstrapthemes: ['cerulean','cosmo','cyborg','darkly','flatly','journal','litera','lumen','lux','materia','minty','morph','pulse','quartz','sandstone','simplex','sketchy','slate','solar','spacelab','superhero','united','vapor','yeti','zephyr'] # Default should be present in bootstrapthemes list (default: null) bootstrapDefaultTheme: ~