Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
All Data Structures Namespaces Files Functions Variables Pages
Validate.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  public function execute()
17  {
18  $response = new \Magento\Framework\DataObject();
19  $response->setError(false);
20  $widgetInstance = $this->_initWidgetInstance();
21  $result = $widgetInstance->validate();
22  if ($result !== true && is_string($result)) {
23  $this->messageManager->addError($result);
24  $this->_view->getLayout()->initMessages();
25  $response->setError(true);
26  $response->setHtmlMessage($this->_view->getLayout()->getMessagesBlock()->getGroupedHtml());
27  }
28  $response = $response->toJson();
29  $this->_translateInline->processResponseBody($response);
30  $this->_response->representJson($response);
31  }
32 }
$response
Definition: 404.php:11