0
我试图用PaginatedRepresentation实施HATEOAS,就像描述文档:不能使用的路径没有URL生成
看到波纹管我的控制器:
$hateoas = HateoasBuilder::create()->build();
$paginatedCollection = new PaginatedRepresentation(
$collection,
$this->generateUrl('getUsers'), // route
array(), // route parameters
1, // page number
2, // limit
11 // total pages
);
return new Response($hateoas->serialize($paginatedCollection, 'json'),
200,
array('Content-Type' => 'application/json'));
,但我得到这个错误:不能使用的路径没有URL生成
问题是? –
错误:您无法使用没有url生成器的路由。 –
请明确您正在使用的软件包和其余相关代码! –