src/Support/StringParser.php
public function parse($template, $data)
    {
//        dump($template, $data);
        if (!is_array($data))
            $data = ['' => $data];

        $replace = [];
        foreach ($data as $key => $value) {
            $replace = array_merge(
                $replace,
                is_array($value)
                    ? $this->parsePair($key, $value, $template)
                    : $this->parseSingle($key, $value, $template)
            );
        }

        $result = strtr($template, $replace);

        return $result;
    }
public function parse($template, $data)
    {
//        dump($template, $data);
        if (!is_array($data))
            $data = ['' => $data];

        $replace = [];
        foreach ($data as $key => $value) {
            $replace = array_merge(
                $replace,
                is_array($value)
                    ? $this->parsePair($key, $value, $template)
                    : $this->parseSingle($key, $value, $template)
            );
        }

        $result = strtr($template, $replace);

        return $result;
    }
@param string $template The template string
@param string|array $data The value the template will be rendered with

@return string The rendered template