定制 pinano/datatables-bundle 二次开发

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

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

pinano/datatables-bundle

Composer 安装命令:

composer require pinano/datatables-bundle

包简介

Symfony2 bundle for wrapping the famous dataTables jquery plugin by SpryMedia

README 文档

README

Current Version

DataTables 1.9.4 + DataTables Plug-ins

Installation

Add bundle to your composer.json file

// composer.json

{
    "require": {
        // ...
        "pinano/datatables-bundle": "dev-master"
    }
}

Or, if you prefer, choose a specific version

// composer.json

{
    "require": {
        // ...
        "pinano/datatables-bundle": "1.9.4.1"
    }
}

Add bundle to your application kernel

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Pinano\DataTablesBundle\PinanoDataTablesBundle(),
        // ...
    );
}

Download the bundle using Composer

$ php composer.phar update pinano/datatables-bundle

Install assets

Given your server's public directory is named "web", install the public vendor resources

$ php app/console assets:install web

Optionally, use the --symlink attribute to create links rather than copies of the resources

$ php app/console assets:install --symlink web

Usage

Once you have imported all the resources to the vendor folder, you can self-import the JS into your Symfony project as usual with:

{# block js #}
{% block javascripts %}
    {% javascripts filter='cssrewrite' output='js/dataTables.js'
        ...
        '@PinanoDataTablesBundle/Resources/public/js/jquery.dataTables.js'
        '@PinanoDataTablesBundle/Resources/public/extras/TableTools/media/js/ZeroClipboard.js'
        '@PinanoDataTablesBundle/Resources/public/extras/TableTools/media/js/TableTools.js'
        ...
        %}
        <script src="{{ asset_url }}"></script>
    {% endjavascripts %}
{% endblock %}

And with the CSS as well using with:

{# block css #}
{% block stylesheets %}
    {% stylesheets filter='cssrewrite' output='css/dataTables.css'
        ...
        'bundles/pinanodatatables/css/jquery.dataTables.css'
        ...
        %}
        <link rel="stylesheet" type="text/css" media="screen" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}

Note: See kriswallsmith/assetic#53 for known limitations of assetic with CSS referencing.

Licenses

I do not own DataTables files at all, I'm just providing a Bundle package to easy-install them all. Refer to the source code of the included files from DataTables for license information.

References

  1. http://datatables.net/
  2. http://www.sprymedia.co.uk/
  3. http://symfony.com

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-05-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固