Essence\Replacer::replace PHP Method

replace() public method

By default, links will be replaced by the html property of Media. If $template is a callable function, it will be used to generate replacement strings, given a Media object.
public replace ( string $text, callable $template = null, array $options = [] ) : string
$text string Text in which to replace URLs.
$template callable Templating callback.
$options array Custom options to be interpreted by a provider.
return string Text with replaced URLs.
    public function replace($text, $template = null, array $options = [])
    {
        if (!is_callable($template)) {
            $template = $this->_defaultTemplate();
        }
        return preg_replace_callback($this->_urlPattern, $this->_replaceFunction($template, $options), $text);
    }