public function render()
    {
        $template = $this->getTemplate();

        // Find the expressions
        $matches = [];
        if (!preg_match_all('!\{([\w\.\\\ \/]*)\}!', $template, $matches)) {
            return $template;
        }

        $expressions = $matches[1];
        $expressions = array_unique($expressions);
        foreach ($expressions as $expression) {
            $renderedExpression = $this->renderExpression($expression);
            if (is_object($renderedExpression) && !method_exists($renderedExpression, '__toString')) {
                throw new InvalidExpressionException(
                    'Could not convert object of class ' . get_class(
                        $renderedExpression
                    ) . ' for expression ' . $expression . ' to string', 1401543101
                );
            }
            $template = str_replace('{' . $expression . '}', $renderedExpression, $template);
        }

        return $template;
    }