Download the PHP package dragon-code/size-sorter without Composer
On this page you can find all versions of the php package dragon-code/size-sorter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dragon-code/size-sorter
More information about dragon-code/size-sorter
Files in dragon-code/size-sorter
Package size-sorter
Short Description Easily sort clothing size, height, bra size, furniture size and more
License MIT
Informations about the package size-sorter
Product Size Sorter
Easily sort clothing size, height, bra size, furniture size and more
Installation
To get the latest version of Product Size Sorter
, simply require the project
using Composer:
Or manually update require
block of composer.json
and run composer update.
[!TIP]
When using the Laravel framework, make sure that its version is 11.0 or greater.
Usage
When calling a sort with common values, each element will be assigned to one of five groups:
- Letter clothing size (XXS, XS, M, L, 2XL, etc.)
- Numerical size of clothes and shoes (9, 10, 44-46, 48, etc.)
- Bra size (70B, 75A, 80C, etc...)
- Overall dimensions of items (40x38x19 sm, etc.)
- Volumes (450 ml, 30 l, 450ml, 30l, etc.)
- Other values
The static items
method is also available:
Groups Order
By default, sizes are sorted by the following logical blocks:
- Letter clothing size (XXS, XS, M, L, 2XL, etc.)
- Numerical size of clothes and shoes (9, 10, 44-46, 48, etc.)
- Bra size (70B, 75A, 80C, etc...)
- Overall dimensions of items (40x38x19 sm, etc.)
- Volumes (450 ml, 30 l, 450ml, 30l, etc.)
- Other values
But you can change the order by specifying identifiers as the third parameter:
The final array will be formed in the specified order:
You can also specify some groups. For example:
In this case, the first two logical groups will be sorted in the specified order, and the subsequent ones will be in ascending order:
Custom Column
When working with an array of objects, you can specify which value can be used for sorting.
You can also use "dotted" notation:
And you can use the callback function in the same way:
And this is also possible:
Upgrade Guide
You can find the upgrade documentation here.
License
This package is licensed under the MIT License.