当我将菜单链接添加到帖子列表时:
主要-menu.yaml :
title: news
type: post-list
code: ''
cmsPage: news-list
replace: '0'
viewBag:
isHidden: '0'
cssClass: ''
isExternal: '0'
我正在处理错误:
未定义的索引:slug /home/vagrant/Code/foo/plugins/indikator/news/models/Posts.php第256行
$page = CmsPage::loadCached($theme, $pageCode);
if (!$page) {
return;
}
$properties = $page->getComponentProperties('newsPost');
if (!preg_match('/^\{\{([^\}]+)\}\}$/', $properties['slug'], $matches)) {
return;
}
$paramName = substr(trim($matches[1]), 1);
return CmsPage::url($page->getBaseFileName(), [$paramName => $item->slug]);
}