2016-10-30 88 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'}) }}