Symfony2 寻呼机芬达
Symfony2 Pager Fanta
是否可以在 symfony2 中使用 pager fanta 设置路由/渲染控制器,因为我已经尝试渲染控制器,但它让我无法生成路由:
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') }}
这样试试
{{ pagerfanta(pager, 'twitter_bootstrap3', {'routeName': 'your_route_name'}) }}
我不知道你是如何使用 WhiteOctoberPagerfantaBundle
但你可以设置你的默认视图:https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle#adding-views. Also see this answer: .
或者,pagerfanta
函数采用第三个参数和选项来创建路由生成器。 https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle/blob/master/Twig/PagerfantaExtension.php#L100.
值得注意的是,routeName
可能足以满足您的需要:
{{ pagerfanta(pager, 'twitter_bootstrap3', {routeName: 'route_name'}) }}
是否可以在 symfony2 中使用 pager fanta 设置路由/渲染控制器,因为我已经尝试渲染控制器,但它让我无法生成路由:
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') }}
这样试试
{{ pagerfanta(pager, 'twitter_bootstrap3', {'routeName': 'your_route_name'}) }}
我不知道你是如何使用 WhiteOctoberPagerfantaBundle
但你可以设置你的默认视图:https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle#adding-views. Also see this answer:
或者,pagerfanta
函数采用第三个参数和选项来创建路由生成器。 https://github.com/whiteoctober/WhiteOctoberPagerfantaBundle/blob/master/Twig/PagerfantaExtension.php#L100.
值得注意的是,routeName
可能足以满足您的需要:
{{ pagerfanta(pager, 'twitter_bootstrap3', {routeName: 'route_name'}) }}