j6s/flow-transliterated-routes

Small package that ties in behat/transliterator with flows IdentityRoutePart to create smart international slugs

Installs: 20 229

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:neos-package

2.0.0 2021-01-31 19:47 UTC

This package is auto-updated.

Last update: 2024-04-29 04:20:17 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 default IdentityRoutePart 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.