Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maslo2017/phalcon-data-table

phalcon-data-table libiray
https://github.com/maslo2017/phalcon-data-table

Last synced: 3 months ago
JSON representation

phalcon-data-table libiray

Awesome Lists containing this project

README

        

# phalcon-data-table

This library allows you to simplify the interaction with the [bootstrap-table](https://examples.bootstrap-table.com)
in the [Phalcon](https://github.com/phalcon/cphalcon)

## Install
```php
$loader = new \Phalcon\Loader();

$loader->registerNamespaces(
[
'Masvp' => APP_PATH.'/library/',
]);

$loader->registerDirs(
[
APP_PATH.'/library/',
]);
```

## Sample
**php**
```php
$model = new ResetPasswords();

$creator = new MySqlCreater($model, [
'columns' => 'id,usersId,ipAddress,type,createdAt',
's_columns' => 'ipAddress',
'conditions' => ['usersId = :user_id_con:'],
'bind' => ['user_id_con' => $user->id],
'data' => $this->request->getPost(),
]);

return $this->response->setJsonContent($creator->getResult());
```
**html**
```html

```
**javascript**
```javascript
$('#table-reset-passwords').bootstrapTable('destroy').bootstrapTable({
locale : 'ru-RU',
filter : true,
columns: [
{
field : 'id',
title : 'ID',
sortable : true,
align : 'center',
},
{
field : 'userId',
title : 'User ID',
sortable : true,
align : 'center',
},
{
field : 'ipAddress',
title : 'IP',
sortable : false,
align : 'center',
filter: {
type:'input'
},
}, {
field : 'type',
title : 'Type',
sortable : false,
align : 'center'
}, {
field : 'createdAt',
title : 'Date',
sortable : true,
align : 'center',
formatter: unixTimeFormater,
},
],
});
```
![Simple result table](table-simple.jpg "Simple result table")

## Documentation
[information](/Documentation.md)

[bootstrap-table documentation](https://bootstrap-table.com/docs/getting-started/introduction/)

[bootstrap-table select2 filter](https://bootstrap-table.com/docs/extensions/select2-filter/)