當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ManagerInterface::addSuccessMessage方法代碼示例

本文整理匯總了PHP中Magento\Framework\Message\ManagerInterface::addSuccessMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP ManagerInterface::addSuccessMessage方法的具體用法?PHP ManagerInterface::addSuccessMessage怎麽用?PHP ManagerInterface::addSuccessMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\Message\ManagerInterface的用法示例。


在下文中一共展示了ManagerInterface::addSuccessMessage方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 /**
  * Refresh suppressed contacts.
  */
 public function execute()
 {
     $result = $this->cronFactory->create()->orderSync();
     $this->messageManager->addSuccessMessage($result['message']);
     $redirectUrl = $this->getUrl('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
     $this->_redirect($redirectUrl);
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento2-extension,代碼行數:10,代碼來源:Ordersync.php

示例2: execute

 /**
  * Refresh suppressed contacts.
  */
 public function execute()
 {
     $result = $this->importerFactory->create()->processQueue();
     $this->messageManager->addSuccessMessage($result['message']);
     $redirectBack = $this->_redirect->getRefererUrl();
     $this->_redirect($redirectBack);
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento2-extension,代碼行數:10,代碼來源:Importersync.php

示例3: execute

 /**
  * Refresh suppressed contacts.
  */
 public function execute()
 {
     $this->catalogFactory->create()->resetCatalog();
     $this->messageManager->addSuccessMessage(__('Done.'));
     $redirectUrl = $this->getUrl('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
     $this->_redirect($redirectUrl);
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento2-extension,代碼行數:10,代碼來源:Catalogreset.php

示例4: execute

 /**
  * Refresh suppressed contacts.
  */
 public function execute()
 {
     $result = $this->cronFactory->create()->contactSync();
     $this->messageManager->addSuccessMessage($result['message']);
     $redirectBack = $this->_redirect->getRefererUrl();
     $this->_redirect($redirectBack);
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento2-extension,代碼行數:10,代碼來源:Contactsync.php

示例5: execute

 /**
  * @throws \Magento\Framework\Exception\LocalizedException
  */
 public function execute()
 {
     $redirectUrl = $this->getUrl('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
     $result = $this->contactFactory->create()->deleteContactIds();
     $this->messageManager->addSuccessMessage('Contact id\'s reseted ' . $result);
     $this->_redirect($redirectUrl);
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento2-extension,代碼行數:10,代碼來源:Deletecontactids.php

示例6: execute

 /**
  * Execute method.
  *
  * @param \Magento\Framework\Event\Observer $observer
  *
  * @return $this
  * @codingStandardsIgnoreStart
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     //@codingStandardsIgnoreEnd
     $groups = $this->context->getRequest()->getPost('groups');
     if (isset($groups['api']['fields']['username']['inherit']) || isset($groups['api']['fields']['password']['inherit'])) {
         return $this;
     }
     $apiUsername = isset($groups['api']['fields']['username']['value']) ? $groups['api']['fields']['username']['value'] : false;
     $apiPassword = isset($groups['api']['fields']['password']['value']) ? $groups['api']['fields']['password']['value'] : false;
     //skip if the inherit option is selected
     if ($apiUsername && $apiPassword) {
         $this->helper->log('----VALIDATING ACCOUNT---');
         $isValid = $this->test->validate($apiUsername, $apiPassword);
         if ($isValid) {
             //save endpoint for account
             foreach ($isValid->properties as $property) {
                 if ($property->name == 'ApiEndpoint' && !empty($property->value)) {
                     $this->saveApiEndpoint($property->value);
                     break;
                 }
             }
             $this->messageManager->addSuccessMessage(__('API Credentials Valid.'));
         } else {
             $this->messageManager->addWarningMessage(__('Authorization has been denied for this request.'));
         }
     }
     return $this;
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento2-extension,代碼行數:36,代碼來源:ApiValidate.php

示例7: execute

 /**
  * Execute method.
  */
 public function execute()
 {
     $datafield = $this->getRequest()->getParam('name');
     $type = $this->getRequest()->getParam('type');
     $default = $this->getRequest()->getParam('default');
     $visibility = $this->getRequest()->getParam('visibility');
     $website = $this->getRequest()->getParam('website', 0);
     $client = $this->dataHelper->getWebsiteApiClient($website);
     if (!empty($datafield)) {
         $response = $client->postDataFields($datafield, $type, $visibility, $default);
         if (isset($response->message)) {
             $this->messageManager->addErrorMessage($response->message);
         } else {
             $this->messageManager->addSuccessMessage('Datafield : ' . $datafield . ' created.');
         }
     }
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento2-extension,代碼行數:20,代碼來源:Save.php

示例8: execute

 /**
  * Execute method.
  */
 public function execute()
 {
     $result = ['errors' => false, 'message' => ''];
     $website = $this->getRequest()->getParam('website', 0);
     $client = false;
     if ($this->data->isEnabled()) {
         $client = $this->data->getWebsiteApiClient($website);
     }
     $redirectUrl = $this->getUrl('adminhtml/system_config/edit', ['section' => 'connector_developer_settings']);
     if (!$client) {
         $this->messageManager->addNoticeMessage('Please enable api first.');
     } else {
         // get all possible datatifileds
         $datafields = $this->datafield->getContactDatafields();
         foreach ($datafields as $key => $datafield) {
             $response = $client->postDataFields($datafield);
             //ignore existing datafields message
             if (isset($response->message) && $response->message != \Dotdigitalgroup\Email\Model\Apiconnector\Client::API_ERROR_DATAFIELD_EXISTS) {
                 $result['errors'] = true;
                 $result['message'] .= ' Datafield ' . $datafield['name'] . ' - ' . $response->message . '</br>';
             } else {
                 if ($website) {
                     $scope = 'websites';
                     $scopeId = $website;
                 } else {
                     $scope = 'default';
                     $scopeId = '0';
                 }
                 /*
                  * map the succesful created datafield
                  */
                 $this->data->saveConfigData('connector_data_mapping/customer_data/' . $key, strtoupper($datafield['name']), $scope, $scopeId);
                 $this->data->log('successfully connected : ' . $datafield['name']);
             }
         }
         if ($result['errors']) {
             $this->messageManager->addNoticeMessage($result['message']);
         } else {
             $this->messageManager->addSuccessMessage('All Datafields Created And Mapped.');
         }
     }
     $this->_redirect($redirectUrl);
 }
開發者ID:dotmailer,項目名稱:dotmailer-magento2-extension,代碼行數:46,代碼來源:Automapdatafields.php

示例9: addRedirectMessage

 /**
  * Append message to the customer session to inform he has been redirected
  *
  * @param \Magento\Catalog\Api\Data\ProductInterface $product The product being redirected to.
  */
 private function addRedirectMessage(ProductInterface $product)
 {
     $message = __("%1 is the only product matching your '%2' research.", $product->getName(), $this->helper->getEscapedQueryText());
     $this->messageManager->addSuccessMessage($message);
 }
開發者ID:smile-sa,項目名稱:elasticsuite,代碼行數:10,代碼來源:RedirectIfOneResult.php


注:本文中的Magento\Framework\Message\ManagerInterface::addSuccessMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。