GloryAdminBundle
GloryAdminBundle 基于 Symfony,使用 AdminLTE 前端而开发的后台管理, (*1)
使用
Composer
composer require foreverglory/admin-bundle
or
add composer.json file, after composer update
, (*2)
{
require: {
"foreverglory/theme-bundle": "dev-master"
}
}
Kernel
//app/AppKernel.php
public function registerBundles()
{
return array(
// require bundles
new Sp\BowerBundle\SpBowerBundle(),
new Glory\Bundle\SettingBundle\GlorySettingBundle(),
new Glory\Bundle\MenuBundle\GloryMenuBundle(),
new Glory\Bundle\WebBundle\GloryWebBundle(),
// core bundle
new Glory\Bundle\AdminBundle\GloryAdminBundle(),
// more ...
);
}
Configure
#app/config/config.yml
sp_bower:
bundles:
# 启用 bower 资源
GloryAdminBundle: ~
glory_setting: ~
glory_menu: ~
glory_admin:
# css,js资源,将替换默认
stylesheets: ~
javascripts: ~
# 仪表盘配置
dashboard:
- { include: AppBundle:Block:analysis.html.twig }
- { controller: AppBundle:Dashboard:calendar }
# more ...
#app/config/routing.yml
glory_admin:
resource: "@GloryAdminBundle/Resources/config/routing.yml"
prefix: /
#app/config/security.yml
security:
access_control:
- { path: ^/admin, role: ROLE_ADMIN }
Data
php app/console sp:bower:install
php app/console gloryadmin:install menu
Enjoy it