A ServiceLocator implementation for loading and retaining package objects.
array<string, array<string, bool>>
Tracks whether a registry entry has been converted from a callable to a Package object.
array<string, array<string,Cake\I18n\Package|callable>>
A registry of packages.
Constructor.
Gets a Package object.
Check if a Package object for given name and locale exists in registry.
Sets a Package loader.
__construct(array<string, array<string,Cake\I18n\Package|callable>> $registry = [])
Constructor.
array<string, array<string,Cake\I18n\Package|callable>>
$registry optional A registry of packages.
get(string $name, string $locale): Cake\I18n\Package
Gets a Package object.
string
$name The package name.
string
$locale The locale for the package.
Cake\I18n\Package
has(string $name, string $locale): bool
Check if a Package object for given name and locale exists in registry.
string
$name The package name.
string
$locale The locale for the package.
bool
set(string $name, string $locale, Cake\I18n\Package|callable $spec): void
Sets a Package loader.
string
$name The package name.
string
$locale The locale for the package.
Cake\I18n\Package|callable
$spec A callable that returns a package or Package instance.
void
Tracks whether a registry entry has been converted from a callable to a Package object.
array<string, array<string, bool>>
A registry of packages.
Unlike many other registries, this one is two layers deep. The first key is a package name, the second key is a locale code, and the value is a callable that returns a Package object for that name and locale.
array<string, array<string,Cake\I18n\Package|callable>>
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.I18n.PackageLocator.html