Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
Page Class Reference
Inheritance diagram for Page:
AbstractHelper

Public Member Functions

 __construct (\Magento\Framework\App\Helper\Context $context, \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Cms\Model\Page $page, \Magento\Framework\View\DesignInterface $design, \Magento\Cms\Model\PageFactory $pageFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Escaper $escaper, \Magento\Framework\View\Result\PageFactory $resultPageFactory)
 
- Public Member Functions inherited from AbstractHelper
 __construct (Context $context)
 
 isModuleOutputEnabled ($moduleName=null)
 

Data Fields

const XML_PATH_NO_ROUTE_PAGE = 'web/default/cms_no_route'
 
const XML_PATH_NO_COOKIES_PAGE = 'web/default/cms_no_cookies'
 
const XML_PATH_HOME_PAGE = 'web/default/cms_home_page'
 

Protected Member Functions

 setLayoutType ($inRange, $resultPage)
 
- Protected Member Functions inherited from AbstractHelper
 _getRequest ()
 
 _getModuleName ()
 
 _getUrl ($route, $params=[])
 

Protected Attributes

 $_design
 
 $_page
 
 $messageManager
 
 $_localeDate
 
 $_storeManager
 
 $_pageFactory
 
 $_escaper
 
 $resultPageFactory
 
- Protected Attributes inherited from AbstractHelper
 $_moduleName
 
 $_request
 
 $_moduleManager
 
 $_logger
 
 $_urlBuilder
 
 $_httpHeader
 
 $_eventManager
 
 $_remoteAddress
 
 $urlEncoder
 
 $urlDecoder
 
 $scopeConfig
 
 $_cacheConfig
 

Detailed Description

CMS Page Helper @SuppressWarnings(PHPMD.CouplingBetweenObjects) @SuppressWarnings(PHPMD.CyclomaticComplexity) @SuppressWarnings(PHPMD.NPathComplexity)

Definition at line 16 of file Page.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\App\Helper\Context  $context,
\Magento\Framework\Message\ManagerInterface  $messageManager,
\Magento\Cms\Model\Page  $page,
\Magento\Framework\View\DesignInterface  $design,
\Magento\Cms\Model\PageFactory  $pageFactory,
\Magento\Store\Model\StoreManagerInterface  $storeManager,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface  $localeDate,
\Magento\Framework\Escaper  $escaper,
\Magento\Framework\View\Result\PageFactory  $resultPageFactory 
)

Constructor

Parameters
\Magento\Framework\App\Helper\Context$context
\Magento\Framework\Message\ManagerInterface$messageManager
\Magento\Cms\Model\Page$page
\Magento\Framework\View\DesignInterface$design
\Magento\Cms\Model\PageFactory$pageFactory
\Magento\Store\Model\StoreManagerInterface$storeManager
\Magento\Framework\Stdlib\DateTime\TimezoneInterface$localeDate
\Magento\Framework\Escaper$escaper
\Magento\Framework\View\Result\PageFactory$resultPageFactory@SuppressWarnings(PHPMD.ExcessiveParameterList)

Definition at line 93 of file Page.php.

103  {
104  $this->messageManager = $messageManager;
105  $this->_page = $page;
106  $this->_design = $design;
107  $this->_pageFactory = $pageFactory;
108  $this->_storeManager = $storeManager;
109  $this->_localeDate = $localeDate;
110  $this->_escaper = $escaper;
111  $this->resultPageFactory = $resultPageFactory;
112  parent::__construct($context);
113  }
$storeManager
$page
Definition: pages.php:8

Member Function Documentation

◆ setLayoutType()

setLayoutType (   $inRange,
  $resultPage 
)
protected

Set layout type

Parameters
bool$inRange
\Magento\Framework\View\Result\Page$resultPage
Returns
\Magento\Framework\View\Result\Page

Definition at line 209 of file Page.php.

210  {
211  if ($this->_page->getPageLayout()) {
212  if ($this->_page->getCustomPageLayout()
213  && $this->_page->getCustomPageLayout() != 'empty'
214  && $inRange
215  ) {
216  $handle = $this->_page->getCustomPageLayout();
217  } else {
218  $handle = $this->_page->getPageLayout();
219  }
220  $resultPage->getConfig()->setPageLayout($handle);
221  }
222  return $resultPage;
223  }
$handle

Field Documentation

◆ $_design

$_design
protected

Definition at line 38 of file Page.php.

◆ $_escaper

$_escaper
protected

Definition at line 72 of file Page.php.

◆ $_localeDate

$_localeDate
protected

Definition at line 53 of file Page.php.

◆ $_page

$_page
protected

Definition at line 43 of file Page.php.

◆ $_pageFactory

$_pageFactory
protected

Definition at line 67 of file Page.php.

◆ $_storeManager

$_storeManager
protected

Definition at line 60 of file Page.php.

◆ $messageManager

$messageManager
protected

Definition at line 48 of file Page.php.

◆ $resultPageFactory

$resultPageFactory
protected

Definition at line 77 of file Page.php.

◆ XML_PATH_HOME_PAGE

const XML_PATH_HOME_PAGE = 'web/default/cms_home_page'

CMS home page config path

Definition at line 31 of file Page.php.

◆ XML_PATH_NO_COOKIES_PAGE

const XML_PATH_NO_COOKIES_PAGE = 'web/default/cms_no_cookies'

CMS no cookies config path

Definition at line 26 of file Page.php.

◆ XML_PATH_NO_ROUTE_PAGE

const XML_PATH_NO_ROUTE_PAGE = 'web/default/cms_no_route'

CMS no-route config path

Definition at line 21 of file Page.php.


The documentation for this class was generated from the following file: