Download the PHP package astral-php/astral-utilities without Composer
On this page you can find all versions of the php package astral-php/astral-utilities. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package astral-utilities
astral-utilities
Helpers génériques pour Astral MVC — zéro dépendance.
Classes pures, testables, utilisables avec ou sans ServiceProvider.
Compatibilité
- PHP:
^8.1(8.1 → 8.5) - Astral MVC:
^1.1(recommandé ≥ 1.1.3) pour le ServiceProvider optionnel
Installation
Usage sans provider (recommandé)
ServiceProvider optionnel
Dans config/dependencies.php :
Partage dans les vues : $str, $date, $arr (noms de classes pour appels statiques, ex. $str::slug('…')).
API
Str
| Méthode | Rôle |
|---|---|
slug($value, $separator = '-') |
Slug URL ASCII |
truncate($value, $limit = 100, $end = '…') |
Coupe en caractères |
excerpt($value, $limit = 30, $end = '…') |
Coupe en mots |
limit(...) |
Alias de truncate |
ascii($value) |
Translittération accents courants |
Date
| Méthode | Rôle |
|---|---|
format($value, $format = 'd/m/Y H:i', $timezone = null) |
Formatage |
diffForHumans($value, $now = null, $timezone = null) |
Relatif FR |
Arr
| Méthode | Rôle |
|---|---|
only($array, $keys) |
Filtre par clés |
except($array, $keys) |
Exclut des clés |
flatten($array) |
Aplatit |
get($array, $key, $default = null) |
Notation pointée |
Tests
Licence
MIT
All versions of astral-utilities with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.3
The package astral-php/astral-utilities contains the following files
Loading the files please wait ...