public function renderSection($template, $section, array $data = [], $class = null)
    {
        if (! is_array($section) && ! is_string($section)) {
            throw new InvalidArgumentException(
                'Section to render must be passed as string or array of strings.'
            );
        }
        $sections = is_string($section) ? [$section] : array_filter($section, 'is_string');
        $outputs = new \stdClass();
        $setter = function ($name, $content) use ($sections, $outputs) {
            in_array($name, $sections, true) and $outputs->$name = $content;
        };
        $this->events->on('f.sections.content', $setter);
        $this->render($template, $data, $class);
        $this->events->removeListener('f.sections.content', $setter);
        $result = array_merge(array_fill_keys($sections, ''), get_object_vars($outputs));

        return is_array($section) ? $result : $result[$section];
    }