定制 uam/datatables-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

uam/datatables-bundle

Composer 安装命令:

composer require uam/datatables-bundle

包简介

Datatables jquery plugin packaged as a Symfony bundle

README 文档

README

A symfony 2 bundle that provides a convenient way to include the dataTables jquery plugin in your symfony 2 apps.

This bundle includes release 1.10 of the dataTables plugin. It also includes the plugin's bootstrap-related additions.

Installation

Add the bundle to your project's composer.json:

{
    "require": {
        "uam/datatables-bundle": "~3.0",
        ...
    }
}

Run composer install or composer update to install the bundle:

$ php composer.phar update uam/datatables-bundle

Enable the bundle in the app's kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new UAM\Bundle\DatatablesBundle\UAMDatatablesBundle(),
    );
}

If your composer.json does not include the post-install or post-update installAssets script handler, then run the following command:

$ php app/console assets:install

or

$ php app/console assets:install --symlink

Usage

To learn how to use the dataTables jquery plugin itself, see the plugin's home page at http://www.datatables.net.

To use the bundle itself, simply include the bundle's assets in your templates like you would any other bundle. The dataTables plugin's assets are available under the web/bundles/uamdatatables directory.

# template.html.twig

{% stylesheets filter="cssrewrite"
    'bundles/uamdatatables/vendor/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css'
	'bundles/uamdatatables/vendor/datatables-plugins/integration/font-awesome/dataTables.fontAwesome.css'
	'bundles/uamdatatables/css/table.css'
%}
	<link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="screen" />
{% endstylesheets %}

{% javascripts
	'bundles/uamdatatables/vendor/datatables/media/js/jquery.dataTables.min.js'
	'bundles/uamdatatables/vendor/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js'
%}
	<script src="{{ asset_url }}"></script>
{% endjavascripts %}

If you use assetic, you need to declare the UAMDatatablesBundle in your config file's assetic section.

What's included

The bundle currently includes the following assets:

  • jquery dataTables plugin release 1.10.6
  • dataTables/bootstrap integration plugin
  • dataTables/font-awesome integration plugin

The bundle also includes a DatatablesEnabledControllerTrait and associated assets to help you design pages that list DB-entities using dataTables.

How it works

The bundle's assets are managed via bower and gulp.

Adding more assets

If you need more dataTables assets than are currently included, follow this procedure:

  • Fork the bundle
  • Customize the bower configuration file (Resources/config/bower.json):
    • Add the assets you require in the overrides|datatables-plugins|main section
    • Remove assets you do not require from the overrides section
  • Run gulp from the bundle's Resources\config directory

Licence

This bundle is licensed under the MIT license.

The dataTables jquery plugin is licensed under the MIT license.

Copyright

This bundle is copyright United Asian Management Limited.

The dataTables jquery plugin is copyright Allan Jardine (www.sprymedia.co.uk).

All rights reserved by their respective copyright holders.

统计信息

  • 总下载量: 30.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 8
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固