public function register(Container $container) { $container['pagerfanta.pager_factory'] = function ($container) { return new PagerfantaFactory(); }; $container['pagerfanta.view.default_options'] = array('routeName' => null, 'routeParams' => array(), 'pageParameter' => '[page]', 'proximity' => 3, 'next_message' => '»', 'previous_message' => '«', 'default_view' => 'default'); $container['pagerfanta.view_factory'] = function ($container) { $defaultView = new DefaultView(); $twitterBoostrapView = new TwitterBootstrapView(); $twitterBoostrap3View = new TwitterBootstrap3View(); $factoryView = new ViewFactory(); $factoryView->add(array($defaultView->getName() => $defaultView, $twitterBoostrapView->getName() => $twitterBoostrapView, $twitterBoostrap3View->getName() => $twitterBoostrap3View)); return $factoryView; }; if (isset($container['twig'])) { $container->extend('twig', function ($twig, $app) { $twig->addExtension(new PagerfantaExtension($app)); return $twig; }); } }