2017 © Pedro Peláez
 

library array-organize

Php library for easy sorting of data, generate html table and more.

image

simondevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  • Monday, July 23, 2018
  • by SimonDevelop
  • Repository
  • 1 Watchers
  • 0 Stars
  • 108 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 11 Versions
  • 11 % Grown

The README.md

version Minimum PHP Version Github Actions PHP codecov GitHub license FOSSA Status, (*1)

array-organize

Php library for easy sorting of data, generate html table and more., (*2)

composer require simondevelop/array-organize

Example

 2, "name" => "example 5"],
  ["id" => 1, "name" => "example 5"],
  ["id" => 3, "name" => "example 3"],
  ["id" => 6, "name" => "example 5"],
  ["id" => 5, "name" => "example 3"],
  ["id" => 4, "name" => "example 6"],
  ["id" => 7, "name" => "example 6"],
  ["id" => 8, "name" => "example 7"],
  ["id" => 9, "name" => "example 7"],
  ["id" => 10, "name" => "example 5"]
];

if (isset($_GET['p'])) {
  $page = $_GET['p'];
} else {
  $page = 1;
}

// Init object with data, number by page and current page number
$obj = new ArrayOrganize($data, 3, $page);

// Sort data
$obj->dataSort("id", "ASC");

// Filter data
// $obj->dataFilter(["name" => "example 5"]);

// Css class for the table balise (example with bootstrap 4)
$cssClass = ['table', 'table-striped'];

// Settings of pagination
$pager = [
  "position" => "bottom",
  "lang" => [
    "previous" => " "Next >>"
  ],
  "cssClass" => [
    "ul" => "pagination",
    "li" => "page-item",
    "a" => "page-link",
    "disabled" => [
      "li" => "disabled"
    ],
    "active" => [
      "li" => "active"
    ]
  ],
  "url" => "index.php?p={}"
];

?>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>ArrayOrganize</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"
    integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
  </head>
  <body>
    <div class="container">
      <?php
        // Generate html table (with pager on second parameter)
        echo $obj->generateTable($cssClass, $pager);
      ?>
    </div>
  </body>
</html>

Check this docs for more., (*3)

Go to contribute !

License

FOSSA Status, (*4)

The Versions

23/07 2018

dev-master

9999999-dev https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

17/04 2018

dev-develop

dev-develop https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

13/04 2018

0.1.0

0.1.0.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

12/04 2018

0.0.8

0.0.8.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

12/04 2018

0.0.7

0.0.7.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

12/04 2018

0.0.6

0.0.6.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

10/04 2018

0.0.5

0.0.5.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

09/04 2018

0.0.4

0.0.4.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

29/03 2018

0.0.3

0.0.3.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

28/03 2018

0.0.2

0.0.2.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort

18/01 2018

0.0.1

0.0.1.0 https://github.com/SimonDevelop/array-organize

Php library for easy sorting of data, generate html table and more.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

by Avatar SimonDevelop

array table pagination sort