Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Message
PhraseFactory.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Message
;
7
8
use
Magento\Framework\Phrase
;
9
14
class
PhraseFactory
15
{
24
public
function
create($mainMessage, $subMessages, $separator =
'; '
)
25
{
26
$renderedErrors =
''
;
27
$eol =
''
;
29
foreach
($subMessages as $subMessage) {
30
if
($subMessage instanceof
MessageInterface
) {
31
$phrase =
new
Phrase
($subMessage->getText());
32
}
else
{
33
$phrase =
new
Phrase
(
'Cannot render error message!'
);
34
}
35
$renderedErrors .= $eol . $phrase->render();
36
$eol = $separator;
37
}
38
39
//$mainMessage should contain %1 to be substituted by concatenated errors
40
return
new
Phrase
($mainMessage, [$renderedErrors]);
41
}
42
}
Magento\Framework\Message\PhraseFactory
Definition:
PhraseFactory.php:14
Magento\Framework\Message
Definition:
AbstractMessage.php:6
Magento\Framework\Message\MessageInterface
Definition:
MessageInterface.php:14
Magento\Framework\Phrase
Definition:
Phrase.php:17
Magento\Framework\Phrase