十月CMS + RainLab.Pages + Indikator.News =未定义索引:slug

时间:2017-03-02 21:37:07

标签: php octobercms

当我将菜单链接添加到帖子列表时:

主要-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]);
}

0 个答案:

没有答案