performance improvements (#2329)

* remove work from constructor
* refactor twig extensions
* upgrade theme
* replace sub-request with direct template rendering
This commit is contained in:
Kevin Papst
2021-02-20 23:52:01 +01:00
committed by GitHub
parent 9eb25c412e
commit 607d09aefb
40 changed files with 992 additions and 1092 deletions

View File

@@ -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 = [])