我正在使用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
。