52 \
Magento\Framework\Escaper $escaper =
null 54 parent::__construct($context);
58 $this->escaper = $escaper ?: $this->_objectManager->get(\
Magento\Framework\Escaper::class);
67 $resultJson = $this->resultJsonFactory->create();
68 $resultJson->setHeader(
'Cache-Control',
'max-age=0, must-revalidate, no-cache, no-store',
true);
69 $resultJson->setHeader(
'Pragma',
'no-cache',
true);
71 $sectionNames = $this->
getRequest()->getParam(
'sections');
72 $sectionNames = $sectionNames ? array_unique(\explode(
',', $sectionNames)) : null;
74 $updateSectionId = $this->
getRequest()->getParam(
'update_section_id');
75 if (
'false' === $updateSectionId) {
76 $updateSectionId =
false;
78 $response = $this->sectionPool->getSectionsData($sectionNames, (
bool)$updateSectionId);
79 }
catch (\Exception $e) {
80 $resultJson->setStatusHeader(
81 \
Zend\Http\Response::STATUS_CODE_400,
82 \
Zend\Http\AbstractMessage::VERSION_11,
85 $response = [
'message' => $this->escaper->escapeHtml($e->getMessage())];
__construct(Context $context, JsonFactory $resultJsonFactory, Identifier $sectionIdentifier, SectionPoolInterface $sectionPool, \Magento\Framework\Escaper $escaper=null)