Replaces a inline tpl.
@param string $value value
@param array $placeholders
@return string
167718
public function replaceByPrefix($value, array $placeholders = [])
    {
        $dataPrefix = $this->getNamePrefix($value);
        if (strtolower($dataPrefix['prefix']) === 'inline') {
            $template = clone $this;
            $result = $template->replace($dataPrefix['value'], $placeholders);

            return $result;
        }
        $result = $this->getChunk(trim($value), $placeholders);

        return $result;
    }
1121363
protected function replacePlaceholdersInTemplate($template, array $replace)
    {
        foreach ($replace as $placeholder => $value) {
            $template = str_replace("__{$placeholder}__", $value, $template);
        }

        return $template;
    }
555136
public function translate($template, $placeholders = null)
    {
        $context = $this->_context;

        $locale = $context->locale ?: $this->getLocale();

        if ($pos = strpos($locale, '-')) {
            $fallback = substr($locale, 0, $pos);
        } else {
            $fallback = null;
        }

        if ($this->_messages === null) {
            foreach ($this->_files as $file) {
                $messages = [];
                $file = $this->alias->resolve("$file/$locale.php");
                if (is_file($file)) {
                    /** @noinspection PhpIncludeInspection */
                    $messages = require $file;
                } elseif ($fallback) {
                    $file = $this->alias->resolve("$file/$fallback.php");
                    if (is_file($file)) {
                        /** @noinspection PhpIncludeInspection */
                        $messages = require $file;
                    }
                }

                if ($messages) {
                    if ($this->_messages) {
                        /** @noinspection SlowArrayOperationsInLoopInspection */
                        $this->_messages = array_merge($this->_messages, $messages);
                    } else {
                        $this->_messages = $messages;
                    }
                }
            }
        }

        $message = isset($this->_messages[$template]) ? $this->_messages[$template] : $template;

        if ($placeholders) {
            $replaces = [];

            if (strpos($message, ':') !== false) {
                foreach ($placeholders as $k => $v) {
                    $replaces[':' . $k] = $v;
                }
            }

            if (strpos($message, '{') !== false) {
                foreach ($placeholders as $k => $v) {
                    $replaces['{' . $k . '}'] = $v;
                }
            }

            return strtr($message, $replaces);
        } else {
            return $message;
        }
    }
1267263
protected function compileIncludes($value)
	{
		$pattern = $this->createOpenMatcher('include');

		$replace = '$1<?php echo $__env->make$2, array_except(get_defined_vars(), array(\'__data\', \'__path\')))->render(); ?>';

		return preg_replace($pattern, $replace, $value);
	}
875981
protected function prepareItem(array &$placeholders)
    {
        if (empty($this->prepare['call'])) {
            return;
        }
        $this->prepare['params'] = Helper::getValue($this->prepare['params'], []);
        $this->prepare['params']['placeholders'] = $placeholders;
        $this->prepare['params']['sanitize'] = Template::SANITIZE_DISABLE;
        $placeholders = $this->callFunction($this->prepare['call'], $this->prepare['params']);
    }
1132389
static public function var_replace($value, $data=[])
    {
        $value = str_replace('{$rootUrl}', Config::getRootUrl(), $value);
        $value = str_replace('{$baseUrl}', static::app()->getCurrentModule()->getBaseUrl(true), $value);
        $value = str_replace('{$appName}', Config::getRootUrl(), $value);
        
        if ($data) {
            // replace {$name}
            preg_match_all('/\{\$([a-z\_\-0-9]+)\s*\}/i', $value, $matches, PREG_SET_ORDER);
            
            foreach ($matches as $v) {
                if (isset($data[$v[1]])) {
                    $value = str_replace($v[0], $data[$v[1]], $value);
                }
            }
            
            // replace ${name}
            preg_match_all('/\$\{([a-z\_\-0-9]+)\s*\}/i', $value, $matches, PREG_SET_ORDER);
            
            foreach ($matches as $v) {
                if (isset($data[$v[1]])) {
                    $value = str_replace($v[0], $data[$v[1]], $value);
                }
            }
        }
        
        return $value;
    }
774764
private function replacementC($value, array $modifiers)
    {
        if (!is_array($value)) {
            return $this->implementation->reprCol($this->connection, $value);
        }
        if (isset($value[0])) {
            if ($this->prefix !== null) {
                $t = count($value) - 2;
                if (isset($value[$t])) {
                    $value[$t] = $this->prefix . $value[$t];
                }
            }
            return $this->implementation->reprChainFields($this->connection, $value);
        }
        if (isset($value['col'])) {
            $chain = array();
            foreach (array('db', 'table', 'col') as $f) {
                if (isset($value[$f])) {
                    if (is_array($value[$f])) {
                        $chain = array_merge($chain, $value[$f]);
                    } else {
                        $chain[] = $value[$f];
                    }
                }
            }
            if ($this->prefix !== null) {
                $t = count($chain) - 2;
                if (isset($chain[$t])) {
                    $chain[$t ] = $this->prefix.$chain[$t];
                }
            }
            $result = $this->implementation->reprChainFields($this->connection, $chain);
        } elseif (isset($value['value'])) {
            if (is_int($value['value'])) {
                $result = $this->implementation->reprInt($this->connection, $value['value']);
            } else {
                $result = $this->implementation->reprString($this->connection, $value['value']);
            }
            if (array_key_exists('col', $value) && isset($value['func'])) {
                $result = '';
            } else {
                $value['value'] = null;
            }
        } elseif (isset($value['func'])) {
            $result = '';
        } else {
            throw new DataInvalidFormat('col', 'required `col`, `value` or `func` field');
        }
        if (isset($value['func'])) {
            $result = $value['func'].'('.$result.')';
        }
        if (isset($value['value'])) {
            $result .= (($value['value'] > 0) ? '+' : '').(int)$value['value'];
        }
        if (isset($value['as'])) {
            $result .= ' AS '.$this->implementation->reprCol($this->connection, $value['as']);
        }
        return $result;
    }
1086224
def replace(placeholder, actual)
      raise 'wrong placeholder' if placeholder != @target
      @target.heads.delete(ptrs[0]) if @target
      @target = actual
      @target.heads << @ptrs[0]
      @symbols.map! { |s| s == placeholder ? actual : s }
    end
141519
public function replace(array $placeholders = [])
    {
        if (empty($placeholders)) {
            return $this;
        }
        $callback = function ($value) use ($placeholders) {
            return StringHelper::replace($value, $placeholders, false);
        };
        $this->data = ArrayHelper::map($this->data, $callback, true);
        return $this;
    }
259563
private function replacePlaceholders($raw, $fallback = true)
    {
        if (is_array($raw)) {
            foreach ($raw as $key => $value) {
                $raw[$key] = $this->replacePlaceholders($value, $fallback);
            }

            return $raw;
        }

        if (!is_string($raw)) {
            return $raw;
        }

        $config = $this;

        return preg_replace_callback('~\{\$(.+)\}~', function ($matches) use ($config, $fallback) {
            return $config->get($matches[1], null, $fallback);
        }, $raw);
    }
1360049
static function Replace($placeholder)
    {
        $args = func_get_args();    
        array_shift($args);
        return self::ReplaceArgsUsing($placeholder, null, $args);
    }
138089
public static function replaceTpl($content, array $placeholders = null, Template $template)
    {
        $template = clone $template;
        $template->removeAllPlaceholders();

        return $template->replace($content, $placeholders);
    }
676359
function replacePlaceholders(src, options) {
	return Object.keys(placeholders).reduce((out, placeholder) => {
		return out.replace(new RegExp(`${placeholder}`, 'g'), placeholders[placeholder]);
	}, src);
}
430425
public function placeholder(string $name, string $value): self
    {
        $this->placeholders[$name] = $value;
        return $this;
    }
939845
private function replacementT($value, array $modifiers)
    {
        if (!is_array($value)) {
            return $this->implementation->reprTable($this->connection, $this->prefix.$value);
        }
        if (isset($value[0])) {
            $chain = $value;
        } elseif (isset($value['table'])) {
            if (is_array($value['table'])) {
                $chain = $value['table'];
            } else {
                $chain = array($value['table']);
            }
            if (isset($value['db'])) {
                array_unshift($chain, $value['db']);
            }
        } elseif (!isset($value['table'])) {
            throw new DataInvalidFormat('t', 'required `table` field');
        }
        $lastIdx = count($chain) - 1;
        $chain[$lastIdx] = $this->prefix.$chain[$lastIdx];
        $result = $this->implementation->reprChainFields($this->connection, $chain);
        if (isset($value['as'])) {
            $result .= ' AS '.$this->implementation->reprCol($this->connection, $value['as']);
        }
        return $result;
    }
1201407
public function replacePlaceholders($string, $values, $quoteIfNecessary = true)
    {
        foreach ($values as $placeholder => $value) {
            $replacement = $quoteIfNecessary ? $this->quoteIfNecessary($value) : $value;
            $string = str_replace(":{$placeholder}", $replacement, $string);
        }

        return $string;
    }
598070
protected function transform(array $placeholders)
    {
        if (isset($this->config['parameters'])) {
            ArrayHelper::transform($this->config['parameters'], $placeholders);
            $placeholders = array_merge($this->config['parameters'], $placeholders);
            unset($this->config['parameters']);
        }
        ArrayHelper::transform($this->config, $placeholders);
        $this->rewind();
        return $this;
    }