sjdeboer/datatable-bundle

DataTableBundle是一个允许您将Symfony框架和Doctrine与jQuery的DataTable插件结合使用的Symfony Bundle。

dev-master 2017-08-20 19:49 UTC

This package is not auto-updated.

Last update: 2024-09-29 04:08:58 UTC


README

DataTableBundle是一个允许您将Symfony框架DoctrinejQuery的DataTable插件结合使用的Symfony Bundle。

安装

使用composer将bundle安装到您的Symfony项目中

composer require sjdeboer/datatable-bundle

app/AppKernel.php中注册bundle

// ...

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Sjdeboer\DataTableBundle\SjdeboerDataTableBundle(),
        );

        // ...
    }
}

可选地,您可以将以下配置添加到app/config/config.yml并根据您的需求进行调整。

sdeboer_data_table:
    # Default class added to the HTML table element
    default_table_class: ''

    # Default Datatables options. For available options, see: https://datatables.net.cn/reference/option/
    default_datatables_options:
        searching: false

现在您应该可以开始创建表格了!

使用方法

创建表格与在Symfony中创建表单非常相似。所以您可能会感到非常熟悉。

示例

参考