双元素 / admin-bundle
CMS 的管理包
v1.11.6
2022-08-24 08:15 UTC
Requires
- php: ^7.4 || ^8.0
- symfony/framework-bundle: ^4.4 || ^5.4
- symfonycasts/reset-password-bundle: ^1.13
- twin-elements/admin-translator: ^1.0
- twin-elements/crud-logger: ^1.0
- twin-elements/flashes: ^1.0
- twin-elements/form-extensions: ^1.5
- twin-elements/message: ^1.3
- twin-elements/response-parameter-builder: ^1.0
Conflicts
- twin-elements/message: <1.3
This package is auto-updated.
Last update: 2024-09-24 13:01:14 UTC
README
##安装 composer require twin-elements/admin-bundle
在 /config/packages/routes.yaml
中添加
admin_dashboard:
path: /admin/
controller: TwinElements\AdminBundle\Controller\DashboardController::index
methods: GET
options: { i18n: false }
admin_core:
resource: "@TwinElementsAdminBundle/Controller/"
type: annotation
prefix: /admin
requirements:
_locale: '%app_locales%'
defaults:
_locale: '%locale%'
_admin_locale: '%admin_locale%'
options: { i18n: false }
在 /config/packages/security.yaml
中添加
imports:
- { resource: '@TwinElementsAdminBundle/Resources/config/security.yaml' }
在 /config/packages/twin_elements_admin.yaml
中添加
imports:
- { resource: "@TwinElementsAdminBundle/config/config.yaml" }
twin_elements_admin: ~
如何创建新的角色?
1. 创建一个实现 TwinElements\AdminBundle\Role\RoleGroupInterface
的类
2. 在 services.yaml 中注册该类
<service id="YOUR_CLASS">
<tag name="twin_elements.role" priority="2-999"/>
</service>
3. 角色将自动添加到角色列表中。类型为 4。将翻译添加到 messages.LANG.yaml 中
role:
role_name: Role name
如何创建新的 AdminMenu 项目
1. 创建一个实现 TwinElements\AdminBundle\Menu\AdminMenuInterface
的类
2. 在 services.yaml 中注册该类
<service id="YOUR_CLASS">
<tag name="twin_elements.admin_menu"/>
</service>
3. 完成
创建新的超级管理员用户
在命令行中输入以下命令
php bin/console te:admin:create_super_admin