2016-10-30 87 views
0

它是更多钞票来设置路由/渲染与Symfony2的寻呼机芬达控制器,因为我已经尝试渲染一个控制器和它击中我不能生成路线:Symfony2的寻呼机芬达

An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "" as such route does not exist.") in @AppBundle\Survey\table_questions.html.twig at line 27. 

第27行,我有

{{ pagerfanta(pager, 'twitter_bootstrap3') }} 

回答

0

我不知道你究竟是如何使用WhiteOctoberPagerfantaBundle但您可以设置您的默认视图:https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle#adding-views。另请参阅此答案:Customising the layout of Pagerfanta pagination with a custom template

另外,pagerfanta函数带有第三个参数和选项来创建路由生成器。 https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle/blob/master/Twig/PagerfantaExtension.php#L100

{{ pagerfanta(pager, 'twitter_bootstrap3', {routeName: 'route_name'}) }} 
+0

实际上它routeName的工作,只是因为我对页面的默认值:你需要做什么

值得注意的是routeName可能不够。但你给了我更多的信息,我需要:D –

1

尝试这样

{{ pagerfanta(pager, 'twitter_bootstrap3', {'routeName': 'your_route_name'}) }}