Until now we were using the same render() method and Twig templates for the segments and lists pages. This commit separates them by creating two different render() methods, one for each page, and also separing the Twig templates. Only the translations remain shared as separating them would be more involved and probably not worth it. [MAILPOET-5392]
33 lines
771 B
PHP
33 lines
771 B
PHP
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing
|
|
|
|
namespace MailPoet\AdminPages\Pages;
|
|
|
|
use MailPoet\AdminPages\PageRenderer;
|
|
use MailPoet\Listing\PageLimit;
|
|
|
|
class StaticSegments {
|
|
/** @var PageRenderer */
|
|
private $pageRenderer;
|
|
|
|
/** @var PageLimit */
|
|
private $listingPageLimit;
|
|
|
|
public function __construct(
|
|
PageRenderer $pageRenderer,
|
|
PageLimit $listingPageLimit
|
|
) {
|
|
$this->pageRenderer = $pageRenderer;
|
|
$this->listingPageLimit = $listingPageLimit;
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function render() {
|
|
$data = [];
|
|
$data['items_per_page'] = $this->listingPageLimit->getLimitPerPage('segments');
|
|
|
|
$this->pageRenderer->displayPage('segments/static.html', $data);
|
|
}
|
|
}
|