Class ChainMessagesLoader
Wraps multiple message loaders calling them one after another until one of them returns a non-empty package.
Namespace: Cake\I18n
Method Summary
-
__construct() public
Receives a list of callable functions or objects that will be executed one after another until one of them returns a non-empty translations package
-
__invoke() public
Executes this object returning the translations package as configured in the chain.
Method Detail
__construct() ¶ public
__construct(array<callable> $loaders)
Receives a list of callable functions or objects that will be executed one after another until one of them returns a non-empty translations package
Parameters
-
array<callable>$loaders The list of callables to execute one after another for loading messages
__invoke() ¶ public
__invoke(): Cake\I18n\Package
Executes this object returning the translations package as configured in the chain.
Returns
Cake\I18n\PackageThrows
Cake\Core\Exception\CakeExceptionif any of the loaders in the chain is not a valid callable