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
Phrase
Renderer
Placeholder.php
Go to the documentation of this file.
1
<?php
8
namespace
Magento\Framework\Phrase\Renderer
;
9
10
use
Magento\Framework\Phrase\RendererInterface
;
11
12
class
Placeholder
implements
RendererInterface
13
{
21
public
function
render
(array
$source
, array $arguments)
22
{
23
$text
= end(
$source
);
24
25
if
(
$arguments
) {
26
$placeholders = array_map([$this,
'keyToPlaceholder'
], array_keys(
$arguments
));
27
$pairs = array_combine($placeholders,
$arguments
);
28
$text
= strtr(
$text
, $pairs);
29
}
30
31
return
$text
;
32
}
33
41
private
function
keyToPlaceholder($key)
42
{
43
return
'%'
. (is_int($key) ? (string)($key + 1) : $key);
44
}
45
}
Magento\Framework\Phrase\Renderer
Definition:
Composite.php:8
$source
$source
Definition:
source.php:23
Magento\Framework\Phrase\Renderer\Placeholder\render
render(array $source, array $arguments)
Definition:
Placeholder.php:21
$text
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition:
pager.phtml:43
Magento\Framework\Phrase\RendererInterface
Definition:
RendererInterface.php:16
$arguments
$arguments
Definition:
final_price.phtml:24
Magento\Framework\Phrase\Renderer\Placeholder
Definition:
Placeholder.php:12