【发布时间】:2019-03-18 07:10:21
【问题描述】:
我的网址是
backPid=5&tx_viextendednews_newsblog%5Baction%5D=show&tx_viextendednews_newsblog%5Bcontroller%5D=Extendednews&tx_viextendednews_newsblog%5Bextendednews%5D=1
我想成功
/news-detail/newstitle/?backpid=5
我写在我的 ext_local.conf 文件中 $GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['CustomPlugin'] = \VrisiniInfotechLLP\ViExtendednews\Routing\CustomEnhancer::class;
我的客户增强器是
class CustomEnhancer extends AbstractEnhancer implements RoutingEnhancerInterface, ResultingInterface
{
/**
* @var array
*/
protected $configuration;
/**
* @var string
*/
protected $namespace;
public function __construct(array $configuration)
{
$this->configuration = $configuration;
$this->namespace = $this->configuration['namespace'] ?? '';
}
}
我的 config.yaml 路径是 /siteroot/typo3conf/sites/文件夹名/config.yaml
routeEnhancers:
NewsPlugin:
type: Extbase
limitToPages: [13]
extension: Extendednews
plugin: newsblog
routes:
- { routePath: '/detail/{news_title}', _controller: 'Extendednews::show', _arguments: {'news_title': 'news'} }
defaultController: 'Extendednews::show'
aspects:
news_title:
type: PersistedAliasMapper
tableName: 'tx_news_domain_model_news'
routeFieldName: 'path_segment'
routeValuePrefix: '/'
我怎么知道这个文件在内部工作? 现在我的问题是我应该在这个文件中写什么,以便获得所需的 url?
【问题讨论】:
标签: router typo3-extensions realurl typo3-9.x