performance improvements (#2329)
* remove work from constructor * refactor twig extensions * upgrade theme * replace sub-request with direct template rendering
This commit is contained in:
@@ -31,7 +31,6 @@ class PaginationExtension extends AbstractExtension
|
||||
|
||||
public function __construct(UrlGeneratorInterface $router)
|
||||
{
|
||||
$this->view = new TwitterBootstrap3View();
|
||||
$this->router = $router;
|
||||
}
|
||||
|
||||
@@ -46,6 +45,15 @@ class PaginationExtension extends AbstractExtension
|
||||
];
|
||||
}
|
||||
|
||||
private function getView(): ViewInterface
|
||||
{
|
||||
if (null === $this->view) {
|
||||
$this->view = new TwitterBootstrap3View();
|
||||
}
|
||||
|
||||
return $this->view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 1.8
|
||||
*/
|
||||
@@ -70,7 +78,7 @@ class PaginationExtension extends AbstractExtension
|
||||
$options['prev_message'] = '<i class="fas fa-chevron-left"></i>';
|
||||
$options['next_message'] = '<i class="fas fa-chevron-right"></i>';
|
||||
|
||||
return $this->view->render($pagerfanta, $routeGenerator, $options);
|
||||
return $this->getView()->render($pagerfanta, $routeGenerator, $options);
|
||||
}
|
||||
|
||||
private function createRouteGenerator(array $options = [])
|
||||
|
||||
Reference in New Issue
Block a user