-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Adrian edited this page Mar 1, 2024
·
4 revisions
peekaboo provides message formatting utilities using International Components for Unicode, with a fallback on basic string templating.
Requires php 8.1 or later.
ICU support requires the intl
extension.
Building ICU resource bundles uses genrb
.
Recommended installation method is via Composer: simply composer require php-enspired/peekaboo
.
use at\peekaboo\ {
HasMessages,
MakesMessages
};
class Foo implements HasMessages {
use MakesMessages;
public const MESSAGES = [
"welcome" => "welcome to the {place}, we've got fun and games"
];
}
echo (new Foo())->makeMessage("welcome", ["place" => "jungle"]);
Run static analysis with composer test:analyze
Run unit tests with composer test:unit
I'm on IRC at libera#php-enspired
, or open an issue on github. Feedback is welcomed as well.