arne-groskurth/symgrid
Composer 安装命令:
composer require arne-groskurth/symgrid
包简介
Symgrid is a Symfony data grid bundle.
README 文档
README
Symgrid is a Symfony data grid bundle.
Features
- Supports Doctrine Entities (Entity), QueryBuilder (QueryBuilder) and Array (Array) data sources
- Built in column types: Alias, Bool, Currency, Date, DateTime, Numeric and String
- Custom column types definable via Callbacks
- Multiple values collapsible to single column (e.g. comma-separated)
- Automatic column type detection
- Exportable to CSV, HTML, Excel and PDF
- Mass actions
- Row actions
- Generic filters on built in column types
- Column aggregations respecting filters
- Automatic Ajax refresh on filter(s) change
- Row ordering
- Pagination
- JavaScript API for registration of event listeners
- Translation for all labels, column, mass- and row-action titles
Installation
Step 1: Download Symgrid using Composer
Symgrid is available on Packagist and can therefore be installed via Composer:
$ composer require arne-groskurth/symgrid
Step 2: Enable the bundle
The SymgridBundle along with the FontAwesomeBundle needs to be registered on the kernel:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new ArneGroskurth\Symgrid\ArneGroskurthSymgridBundle(), new Bmatzner\FontAwesomeBundle\BmatznerFontAwesomeBundle() ); }
Step 3: Install assets
$ php app/console assets:install --symlink
Two stylesheets are available afterwards:
- layout.css: Functional stylings taking care e.g. of the visibility of the loading indicator
- style.css: Bundled grid style as seen on the screenshot above
It is recommended to include both styles and modify them in the applications stylings:
<link rel="stylesheet" href="{{ asset('bundles/arnegroskurthsymgrid/layout.css') }}" /> <link rel="stylesheet" href="{{ asset('bundles/arnegroskurthsymgrid/style.css') }}" />
Done!
Getting started
After the installation Symgrid is available as a service and can be configured e.g. inside a controller.
Basic entity-based grid configuration in controller:
namespace AppBundle\Controller; use AppBundle\Entity\User; use ArneGroskurth\Symgrid\Grid\DataSource\EntityDataSource; use Symfony\Bundle\FrameworkBundle\Controller\Controller; class DefaultController extends Controller { public function testAction() { // Construct grid, set an entity as data source and activate bundled grid style $grid = $this->get('arnegroskurth_symgrid.grid') ->from(User::class) ->useDefaultStyle() ; // Return grid response or fall back to given template return $grid->getResponse('view.html.twig', array( 'grid' => $grid )); } }
Symgrid rendering in Twig template
{{ symgrid(grid) }}
Documentation
See the table of contents.
License
The MIT License (MIT)
Copyright (c) 2016 Arne Groskurth
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
arne-groskurth/symgrid 适用场景与选型建议
arne-groskurth/symgrid 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 06 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「grid」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 arne-groskurth/symgrid 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 arne-groskurth/symgrid 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 arne-groskurth/symgrid 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, which will add advanced interaction controls to any HTML table.
Plug-ins for DataTables
The bundle for easy using json-rpc api on your project
TYPO3 extension providing content elements powered by gridelements and bootstrap. Available elements: container, columns, tabs, accordion, tile unit and card.
Bundle Symfony DaplosBundle
Show hide change position selected columns in grid, extension for Yii 2.0 Framework
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-06-29
