georgringer/routing-with-not-found-records

在PersistedAliasMapper中允许未找到的记录

1.0.0 2022-01-27 11:24 UTC

This package is auto-updated.

Last update: 2024-08-27 19:16:05 UTC


README

此扩展使您能够使用PersistedAliasMapper和缺失的记录。一个典型的用例是例如EXT:news与新闻记录。如果记录被隐藏、删除或达到开始/结束时间,则扩展现在可以再次处理,而不是触发页面未找到错误。

使用方法

  1. 使用composer req georgringer/routing-with-not-found-records安装。
  2. 在您的路由配置中将PersistedAliasMapper替换为PersistedAliasMapperWithNotFoundRecords

完整示例

routeEnhancers:
  News:
    type: Extbase
    extension: News
    plugin: Pi1
    routes:
      - routePath: '/{news-title}'
        _controller: 'News::detail'
        _arguments:
          news-title: news
    aspects:
      news-title:
        type: PersistedAliasMapperWithNotFoundRecords
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment