gubler / uuid-encoder-bundle
This bundle provides Symfony integration for gubler/uuid-encoder.
Installs: 52
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Type:symfony-bundle
Requires
- php: ^7.1 || ^8.0
- gubler/uuid-encoder: ^0.5
- symfony/config: 5.*
- symfony/dependency-injection: 5.*
- symfony/http-kernel: ^4.3 || >=5.1.5
Requires (Dev)
- symfony/phpunit-bridge: ^4.3 || 5.*
- twig/twig: ^2.4 || ^3.0
Suggests
- twig/twig: required to use the provided Twig extension. Version 2.4 or greater needed
README
This bundle provides Symfony integration for gubler/uuid-encoder with some helper utilities and twig extensions.
This autowires/autoconfigures the following classes:
UuidEncoder
UrlUuidEncoder
FilesystemUuidEncoder
Each has default character sets (which characters are used to encode the UUID). UrlUuidEncoder
and FilesystemUuidEncoder
are wrappers around UuidEncoder
that define a default character set.
You can configure the character set for each class by updating the config/packages/gubler_uuid_encoder.yaml
file (shown here with defaults:
gubler_uuid_encoder: charset: default: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 url: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_~. filesystem: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
You can also use the following Twig extensions for encoding UUIDs in your templates:
{# data.id is a UUID #} Encoded UUID with UuidEncoder is {{ data.id|uuidEncoder }} Encoded UUID with UrlUuidEncoder is {{ data.id|urlUuid }} Encoded UUID with FilesystemUuidEncoder is {{ data.id|filesystemUuid }}