Download the PHP package shemgp/ssp without Composer
On this page you can find all versions of the php package shemgp/ssp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Vendor shemgp
Package ssp
Short Description Datatables SSP class for PHP server side scripting for PostgreSQL
License MIT
Package ssp
Short Description Datatables SSP class for PHP server side scripting for PostgreSQL
License MIT
Please rate this library. Is it a good library?
Informations about the package ssp
ssp
Datatables SSP class for server side scripting for PostgreSQL (uses ILIKE)
Extra features
- May have columns for actions which are not in the database (eg.
@actions) that can be used to display actions. The name should start with@.
Sample code using Slim with slim_plates
<?php
$crud = [
'table_name' => 'students',
'fields' => [
'first' => 'text',
'middle' => 'text',
'last' => 'text',
'bday' => 'date',
'gender' => 'text'
]
];
$app->get('/'.$crud['table_name'].'/list', function ($request, $response, $args) use ($crud) {
$columns = [];
$count = 0;
foreach($crud['fields'] as $field => $data_type)
{
$column = ['db' => $field, 'dt' => $count++];
if ($data_type == 'date')
$column['formatter'] = function( $d, $row ) {
return date( 'F d, Y', strtotime($d));
};
else if ($data_type == 'number')
$column['formatter'] = function( $d, $row ) {
return '$'.number_format($d);
};
$columns[] = $column;
}
$columns[] = ['db' => 'id', 'dt' => $count++];
$columns[] = [
'db' => '@actions',
'dt' => $count++,
'formatter' => function ($d, $row ) use ($crud) {
return '<div class="btn-group btn-group-sm">
<a href="'.$this->router->pathFor($crud['table_name'].'.update', ['id'=>$row['id']]).'" class="btn btn-info btn-sm"><i class="fa fa-edit"></i></a>
<form action="'.$this->router->pathFor($crud['table_name'].'.delete', ['id'=>':id']).'" method="POST">
<button class="btn btn-danger btn-sm delete-item" onclick="return confirm(\'Are you sure?\')">
<i class="fa fa-trash"></i>
</button>
</form>
</div>';
}
];
$ssp = DataTable\SSP::simple($request->getParams(), $this->db, $crud['table_name'], 'id', $columns);
return json_encode($ssp);
})->setName($crud['table_name'].'.list.json');
All versions of ssp with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.0
The package shemgp/ssp contains the following files
Loading the files please wait ...