本文整理汇总了PHP中Magento\Framework\Message\ManagerInterface::addNoticeMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP ManagerInterface::addNoticeMessage方法的具体用法?PHP ManagerInterface::addNoticeMessage怎么用?PHP ManagerInterface::addNoticeMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Message\ManagerInterface
的用法示例。
在下文中一共展示了ManagerInterface::addNoticeMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkSearchEngineSupport
/**
* Checks if 'synonyms' feature is supported by configured search engine. If not supported displays a notice
*
* @return void
*/
protected function checkSearchEngineSupport()
{
// Display a notice if search engine configuration does not support synonyms
$searchEngine = $this->engineResolver->getCurrentSearchEngine();
if (!$this->searchFeatureConfig->isFeatureSupported(\Magento\Framework\Search\SearchEngine\ConfigInterface::SEARCH_ENGINE_FEATURE_SYNONYMS, $searchEngine)) {
$this->messageManager->addNoticeMessage(__('Search synonyms are not supported by the %1 search engine. ' . 'Any synonyms you enter won\'t be used.', $searchEngine));
}
}
示例2: 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);
}
示例3: generatetokenAction
/**
* Generate new token and connect from the admin.
*
* @return string
*/
public function generatetokenAction()
{
$adminUser = $this->auth->getUser();
$refreshToken = $adminUser->getRefreshToken();
if ($refreshToken) {
$token = $this->client->getAccessToken($this->buildUrlParams($refreshToken), $this->configFactory->getTokenUrl());
//save the refresh token to the admin user
if (is_string($token)) {
$adminUser->setRefreshToken($token)->save();
}
return $token;
} else {
$this->messageManager->addNoticeMessage('Please Connect To Access The Page.');
}
}
示例4: _checkExpiredPassword
/**
* Check whether the latest password is expired
* Side-effect can be when passwords were changed with different lifetime configuration settings
*
* @param array $latestPassword
* @return void
*/
private function _checkExpiredPassword($latestPassword)
{
if ($latestPassword && $this->observerConfig->_isLatestPasswordExpired($latestPassword)) {
if ($this->observerConfig->isPasswordChangeForced()) {
$message = __('It\'s time to change your password.');
} else {
$myAccountUrl = $this->url->getUrl('adminhtml/system_account/');
$message = __('It\'s time to <a href="%1">change your password</a>.', $myAccountUrl);
}
$this->messageManager->addNoticeMessage($message);
$message = $this->messageManager->getMessages()->getLastAddedMessage();
if ($message) {
$message->setIdentifier('magento_user_password_expired')->setIsSticky(true);
$this->authSession->setPciAdminUserIsPasswordExpired(true);
}
}
}