calien/persisted-sanitized-routing

此包已被废弃且不再维护。作者建议使用calien/extended-routing包。

TYPO3的持久化净化模式路由

安装数: 2,214

依赖项: 0

建议者: 1

安全性: 0

星标: 1

关注者: 2

分支: 1

开放问题: 2

类型:typo3-cms-extension

1.0.4 2022-04-07 09:51 UTC

This package is auto-updated.

Last update: 2022-04-07 09:52:48 UTC


README

#持久化净化模式映射

这是什么?

允许从持久化模式生成净化后的URL部分。默认的PersistedPatternAspect会取例如数据库值并“原样”使用,包括重音符号、特殊字符和空格,这会导致它们返回到URL中并产生意外的行为。

此PersistedSanitizedRoutingAspect会对数据库部分进行编码和解码,并将生成更好的可读URL部分。

它是如何工作的?

添加了一个新的路由方面,扩展了TYPO3核心中的PersistedPatternMapper,并使用净化后的URL部分。

aspects:
  country:
    type: PersistedSanitizedPatternMapper
    tableName: static_countries
    routeFieldPattern: '^(.*)-(?P<uid>\d+)$'
    routeFieldResult: '{cn_short_de|sanitized}-{uid}'
    localeMap:
      - locale: 'de_*'
        field: cn_short_de
      - locale: 'en_*'
        field: cn_short_en
  territory:
    type: PersistedSanitizedPatternMapper
    tableName: static_territories
    routeFieldPattern: '^(.*)-(?P<uid>\d+)$'
    routeFieldResult: '{tr_name_de|sanitized}-{uid}'
    localeMap:
      - locale: 'de_*'
        field: tr_name_de
      - locale: 'en_*'
        field: tr_name_en

如你所见,如果需要,它将尊重本地化。

安装

只需安装扩展,并根据上述描述配置你的持久化模式映射器,以满足你的需求。|净化部分将尊重你想要净化的字段。