尝试创建Sitemap时发生PrestaSitemapBundle转储错误



我正在使用prestashop文档创建站点地图。

当我运行以下命令时

php bin/console presta:sitemaps:dump

我得到以下错误:

Some mandatory parameters are missing ("id") to generate a URL for route "post".

以下是在Controller中发布的代码。

/**
* @Route("/post/{id}/{slug}", name="post")
*/
public function show_post(ManagerRegistry $manager, $id)
{
$post =  $manager->getRepository(Blog::class)->find($id);
return $this->render('main/show_post.html.twig',[
'post' => $post
]);
} 

看起来您还需要向show_post函数参数添加一个$slug

相关内容

  • 没有找到相关文章

最新更新