fr05t1k / admin-theme-bundle
基于AdminLTE模板的Admin主题,易于集成到symfony中
2.0.0-beta.6
2016-12-15 09:17 UTC
Requires
- php: >=5.5.9
- almasaeed2010/adminlte: ^2.3
- symfony/event-dispatcher: >=2.3
- symfony/http-foundation: >=2.3
- symfony/http-kernel: >=2.3
Requires (Dev)
- phpspec/prophecy: ^1.6
Suggests
- knplabs/knp-menu-bundle: Allows easy menu integration.
This package is auto-updated.
Last update: 2024-09-10 00:39:44 UTC
README
基于AdminLTE模板的Admin主题,易于集成到symfony中。此包集成了多个常用的javascript和优秀的AdminLTE模板。
安装
使用composer安装非常简单:此命令将在您的composer.json中添加"avanzu/admin-theme-bundle": "~2.0"
并将包下载下来
php composer.phar require avanzu/admin-theme-bundle
在您的kernel中启用此包
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(), ); }
安装资源(建议使用符号链接方法,但硬拷贝也行)...
php bin/console assets:install --symlink
初始化主题
php bin/console avanzu:admin:initialize [--symlink|--relative]
初始化将在web/theme
文件夹中创建几个符号链接(如果失败则回退到硬拷贝)到所需的almasaeed2010/adminlte
包中
- bootstrap
- dist
- plugins
- 文档
- starter.html
配置
尽管此包应该能够在零配置的情况下运行,但您可能需要调整一些设置以满足您的喜好或需求。请注意,您不需要将整个配置块放入您的配置中,而是将您想要从默认值更改的配置项放入其中。
以下是配置的默认值
# config.yml avanzu_admin_theme: use_twig : true enable_demo: false theme: default_avatar : bundles/avanzuadmintheme/img/avatar.png skin : skin-blue # see skin listing for viable options fixed_layout : false # ------------------------------------------------------- boxed_layout : false # these settings relate directly to the "Layout Options" collapsed_sidebar: false # described in the adminlte documentation mini_sidebar : false # ------------------------------------------------------- control_sidebar : false # controls wether the right hand panel will be rendered knp_menu: # knp menu integration enable : true main_menu : avanzu_main # the menu builder alias to use for the main menu breadcrumb_menu: false # the menu builder alias to use for the breacrumbs
AdminLTE皮肤有
- skin-blue(此包的默认值)
- skin-blue-light
- skin-yellow
- skin-yellow-light
- skin-green
- skin-green-light
- skin-purple
- skin-purple-light
- skin-red
- skin-red-light
- skin-black
- skin-black-light
如果您想了解更多,请查看AdminLTE的文档这里。
演示模式
为了查看几个组件的工作实现,您可以启用演示模式
# config.yml avanzu_admin_theme: enable_demo: true
并将路由添加到您的路由配置中
# routing.yml avanzu_admin: prefix: /admin resource: "@AvanzuAdminThemeBundle/Resources/config/routes.yml"
升级通知
版本 >= 2.0
此版本在模板和资源方面不完全向后兼容。
- 不再依赖于任何外部构建工具或包管理器(当然,除了composer)。因此,没有预包装的脚本/样式或资源组。如果您想使用脚本和/或样式表打包,您可能已经拥有您选择的工具,并且现在可以根据您的需求使用它们。
- 引入了路由名称别名以在组件内部生成URL。
版本 >= 1.3
- 包含位于
Resources/public/static/[prod|dev]
下的预包装资源文件。因此,不再有对bower和/或assetic的严格要求。然而,assetic组仍然存在,应该像往常一样工作。