elao/admin-bundle
最新稳定版本:v1.1.0
Composer 安装命令:
composer require elao/admin-bundle
包简介
Simple, powerful and extendable admin bundle.
README 文档
README
Write your controller once, use it for all your models.
What?
The AdminBundle helps you define reusable Actions that can be defined as route controllers for any model.
Why?
The AdminBundle improves your productivity when implementing similar controller behavior for several models, such as CRUD back-end.
How?
The AdminBundle declares Actions as abstract services, instanciates and configures one instance for each model and register the corresponding route in the Symfony router.
You just need to say "I want a list of user." and the AdminBundle register a /users route that run a ListAction instance configured to handle the User model.
Design goals
The AdminBundle is meant to improve your productivity and remain flexible and extendable.
Installation
Require the bundle in Composer:
$ composer require elao/admin-bundle
Install the bundle in your AppKernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = [ // ... new Elao\Bundle\AdminBundle\ElaoAdminBundle(), ]; }
Import the rounting in your routing.yml configuration file:
// app/config/routing.yml elao_admin_bundle: resource: "@ElaoAdminBundle/Resources/config/routing.yml" prefix: / # You can prefix all actions here
Usage
Use a set of Actions:
- HTML Actions: For easily performing CRUD operations using Symfony forms.
- REST Actions: For building an Api through REST actions.
Or create your own set of actions!
Configuration
Configure some actions in your config.yml:
# app/config/config.yml elao_admin: administrations: # Where 'name' is the name of the administration name: # Administration-level options (optional) foo: true # (required) actions: # Where 'alias' is the alias of the action alias: # Where 'action_type' is a registered action type. action_type: # Every action has its own options
Here's an example with some action provided by the ElaoHtmlActionBundle.
# app/config/config.yml elao_admin: administrations: post: # The name of the administration (usualy, the model name) repository: app.repository.post # The repository to use to access the model actions: list: # A "list" action, html_list: ~ # that use default configuration for "html_list". create: # A "create" action, html_create: # that use "html_create" and specify the form to use. form: BlogBundle\Form\PostType update: # A "update" action, html_update: # that use "html_update" and specify the form to use. form: BlogBundle\Form\PostType read: # A "read" action, html_read: ~ # that use default configuration for "html_read". delete: # A "delete" action, html_delete: # that use "html_delete" and adds a security restriction. security: has_role('ROLE_ADMIN')
This config will generate the following routes:
| Name | Method | Scheme | Host | Path |
|---|---|---|---|---|
| post_list | GET | ANY | ANY | /posts |
| post_create | GET/POST | ANY | ANY | /posts/new |
| post_update | GET/POST | ANY | ANY | /posts/{id}/edit |
| post_read | GET | ANY | ANY | /posts/{id} |
| post_delete | GET/POST | ANY | ANY | /posts/{id}/delete |
Configuration detail
To get the full detail and default values for yout administration just run:
bin/console debug:config ElaoAdminBundle
elao/admin-bundle 适用场景与选型建议
elao/admin-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 550 次下载、GitHub Stars 达 9, 最近一次更新时间为 2014 年 12 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「admin」 「elao」 「crud」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elao/admin-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elao/admin-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elao/admin-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Add routing, container, assetic & twig information inside the profiler
Generate translation key for forms
Various Form improvements
Gii Generator for double model generation
2lenet/EasyAdminPlusBundle
Twitter Bootstrap 3 theme bundle for ElaoThemeBundle
统计信息
- 总下载量: 550
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 31
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-01