Download the PHP package yiisoft/arrays without Composer
On this page you can find all versions of the php package yiisoft/arrays. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yiisoft/arrays
More information about yiisoft/arrays
Files in yiisoft/arrays
Package arrays
Short Description Yii Array Helper
License BSD-3-Clause
Homepage https://www.yiiframework.com/
Informations about the package arrays
Yii Arrays
The package provides:
ArrayHelperthat has static methods to work with arrays;ArraySorterthat has static methods for sort arrays;ArrayAccessTraitprovides the implementation for \IteratorAggregate, \ArrayAccess and \Countable;ArrayableInterfaceandArrayableTraitfor use in classes who want to support customizable representation of their instances.
Requirements
- PHP 8.1 - 8.5.
Installation
ArrayHelper usage
Array helper methods are static so usage is like the following:
Overall the helper has the following method groups.
Getting data
- getValue
- getValueByPath
- getColumn
- getObjectVars
Setting data
- addValue
- addValueByPath
- setValue
- setValueByPath
Removing data
- remove
- removeByPath
- removeValue
Detecting array types
- isIndexed
- isAssociative
HTML encoding and decoding values
- htmlDecode
- htmlEncode
Testing against arrays
- isIn
- isSubset
Transformation
- index
- group
- filter
- map
- merge
- parametrizedMerge
- renameKey
- toArray
Other
- keyExists
- pathExists
ArraySorter usage
Array sorter has one static method which usage is like the following:
ArrayAccessTrait usage
ArrayAccessTrait provides the implementation for
\IteratorAggregate,
\ArrayAccess and
\Countable.
Note that ArrayAccessTrait requires the class using it contain a property named data which should be an array.
The data will be exposed by ArrayAccessTrait to support accessing the class object like an array.
Example of use:
ArrayableInterface and ArrayableTrait usage
ArrayableInterface and its implementation ArrayableTrait intended for use in classes who want to support customizable representation of their instances.
Example of use:
Documentation
- Internals
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
License
The Yii Arrays is free software. It is released under the terms of the BSD License.
Please see LICENSE for more information.
Maintained by Yii Software.