j6s / flow-transliterated-routes
Small package that ties in behat/transliterator with flows IdentityRoutePart to create smart international slugs
Installs: 26 463
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:neos-package
Requires
- php: ^7.3|^8.0
- behat/transliterator: ^1.3.0
- neos/flow: ^6.1|^7.0
Requires (Dev)
- phpstan/phpstan: ^0.12.9
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-03-01 00:16:20 UTC
README
Small package that ties behat/transliterator
into the default behaviour of IdentityRoutePart
of the Flow Framework to create smart international slugs.
Installation
$ composer require j6s/flow-transliterated-routes
Example Routes.yaml
- name: 'My.News:DetailPage' uriPattern: '{article}' routeParts: article: handler: 'J6s\TransliteratedRoutes\IdentityRoutePart' options: objectType: 'My\News\Domain\Model\Article' uriPattern: '{name}-{urlIdentifier}' replacements: '&': 'and' '|': 'or'
Configuration
All configuration from the default IdentityRoutePart
has been retained with the notable difference, that they are shifted into the options
key.
Additionally the following options exist:
additionalReplacements
: Map of replacement that uses the character that should be replaced and it's replacement as a value. In order to be backwards-compatible with Flows defaultIdentityRoutePart
this defaults to replacements for german special characters. If you add replacements of your own and whish to retain german special characters, you have to add them to the map manually.