public function render(array $classes = [], $autoEscape = null)
    {
        $divOpen = '<div class="' . $this->divClass . '">';
        $divClose = '</div>';
        $hasMessages = false;

        foreach ($this->classes as $namespace => $namespaceClasses) {
            $namespaceClasses = ArrayUtils::merge($namespaceClasses, $classes);
            if ($this->getFlashMessengerHelper()->getPluginFlashMessenger()->hasCurrentMessages($namespace)) {
                $hasMessages = true;
                $divOpen .= $this->getFlashMessengerHelper()->renderCurrent($namespace, $namespaceClasses, $autoEscape);
                $this->getFlashMessengerHelper()->getPluginFlashMessenger()->clearCurrentMessagesFromNamespace($namespace);
            } elseif ($this->getFlashMessengerHelper()->getPluginFlashMessenger()->hasMessages($namespace)) {
                $hasMessages = true;
                $divOpen .= $this->getFlashMessengerHelper()->render($namespace, $namespaceClasses, $autoEscape);
            }
        }

        return $hasMessages ? $divOpen . $divClose : '';
    }