Files
piratepoet/mailpoet/lib/AdminPages/Pages/StaticSegments.php
Rodrigo Primo c72fce9aae Separate the segments and lists pages on the PHP side
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]
2023-07-12 18:46:08 +02:00

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);
}
}