Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Placeholder.php
Go to the documentation of this file.
1 <?php
9 
11 
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 }
$source
Definition: source.php:23
render(array $source, array $arguments)
Definition: Placeholder.php:21
endifif( $block->getLastPageNum()>1)( 'Page') ?></strong >< ul class $text
Definition: pager.phtml:43
$arguments