2017 © Pedro Peláez
 

cakephp-plugin arraysort

CakePHP utility for sorting arrays by multiple fields

image

imsamurai/arraysort

CakePHP utility for sorting arrays by multiple fields

  • Thursday, September 18, 2014
  • by imsamurai
  • Repository
  • 2 Watchers
  • 2 Stars
  • 3,013 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

API Documentation

Check out ArraySort API Documentation, (*1)

Abstract

Build Status Coverage Status Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Installation

cd my_cake_app/app
git clone git://github.com/imsamurai/cakephp-arraysort-utility.git Plugin/ArraySort

or if you use git add as submodule:, (*3)

cd my_cake_app
git submodule add "git://github.com/imsamurai/cakephp-arraysort-utility.git" "app/Plugin/ArraySort"

then add plugin loading in Config/bootstrap.php, (*4)

CakePlugin::load('ArraySort');

Usage

In any place of your code:, (*5)

App::uses('ArraySort', 'ArraySort.Utility');

$sorted_array = ArraySort::multisort($array, $params);

where $array is array to sort, $params can be string ('asc' or 'desc') or array like this:, (*6)

$params = array(
        <field1> => <direction>,
        <field2> => <direction2>,
        ...
);

For example:, (*7)

$params = array(
        'rank' => 'desc',
        'created' => 'asc'
);

With this $params method will sort $array by comparing each elements firstly by rank field, if they have equal rank then sort by created field., (*8)

The Versions

18/09 2014

dev-master

9999999-dev http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort

18/09 2014

1.0.7

1.0.7.0 http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort

01/07 2014

1.0.6

1.0.6.0 http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort

12/06 2014

1.0.5

1.0.5.0 http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort

28/05 2014

1.0.4

1.0.4.0 http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort

26/05 2014

1.0.3

1.0.3.0 http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort

23/05 2014

1.0.2

1.0.2.0 http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort

20/05 2014

1.0.1

1.0.1.0 http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort

06/02 2014

1.0.0

1.0.0.0 http://github.com/imsamurai/cakephp-arraysort-utility

CakePHP utility for sorting arrays by multiple fields

  Sources   Download

MIT

The Requires

 

plugin cakephp array sort