定制 whykrr/datatables-builder 二次开发

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

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

whykrr/datatables-builder

Composer 安装命令:

composer require whykrr/datatables-builder

包简介

Builder datatables serverside processing for Codeigniter 4

README 文档

README

builder response datatables serverside processing for Codeigniter 4

Requirements

  • PHP 7+
  • Codeigniter 4.0.0+

Installation

Installation is best done via Composer. Assuming Composer is installed globally, you may use the following command:

composer require whykrr/datatables-builder

Manual Installation

Should you choose not to use Composer to install, you can clone or download this repo and then enable it by editing app/Config/Autoload.php and adding the Myth\Auth namespace to the $psr4 array. For example, if you copied it into app/ThirdParty:

    $psr4 = [
        'Config'            => APPPATH . 'Config',
        APP_NAMESPACE       => APPPATH,
        'App'               => APPPATH,
        'DatatablesBuilder' => APPPATH .'ThirdParty/datatablesbuilder/src',
    ];

Features

  • Serverside data datatables with pagination
  • Helper for initiation datatables
  • Customize search datatables
  • Customize data with helper function

Configuration

Once installed you need to configure the framework to use the DatatablesBuilder library. In your application, perform the following setup

Publish configuration file and JavaScript file with following command

php spark dtbuilder:publish

You can easily add configuration on App/Config/Datatables.php Setup your table with $tableSetting variable:

    // Example configuration
    public $tableSetting = [
        'users' => [
            'col_title' => 'First Name,Last Name,Adress,Status',
            'col_data' => 'first_name,last_name,address,status',
            'helpers' => [
                'status' => ['formatStatus', '{status}'],
            ],
            'numbering' => true,
            'action_button' => 'edit,delete',
        ],
    ];
Key 'users'

'users' key must be unique, as it is used to define the table identity and API url. then the access url for table users is {base_url}/datatables/users

Key 'col_title'

'col_title' key is used to configure column title in the table

Key 'col_data'

'col_title' key is used to configure column data in the table

Key 'helpers'

'helpers' key is used for which configuration data will be overwritten with the return of the helper function, the configuration format see the code as follows

    'helpers' => [
        'key_name_tobe_overwrite' => ['function_name', 'arguments'],
    ],

if argument is more than one then add | as a separator between the arguments, add {key} if the argument contains the row of data to be displayed. Example : '{status}|users'

Key 'numbering'

'numbering' key is used to configure row data with numbering on first column

Key 'action_button'

'action_button' key is used to configure row data with button or links on last column

The configuration above will produce the following display

No Fisrt Name Last Name Adress Status Action Button
{no} {fist_name} {last_name} {adress} {status} {action_btn}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固