protected function doRender(array $options)
    {
        if (!isset($this->templateEngine)) {
            throw new InvalidArgumentException('Missing template engine');
        }

        if (!isset($this->label)) {
            throw new InvalidArgumentException('Missing provider label');
        }

        if (isset($options[$this->label])) {
            $options = array_merge($this->options, $options[$this->label], $options);
            unset($options[$this->label]);
        } else {
            $options = $options + $this->options;
        }

        $template = sprintf(
            'EzSystemsShareButtonsBundle::%s/%s',
            $this->templateName,
            $options['template']
        );

        return $this->templateEngine->render($template, $options);
    }