public function render($items, $config = [])
    {
        if ($this->_rendering) {
            throw new FatalErrorException(__d('menu', 'Loop detected, MenuHelper already rendering.'));
        }

        $items = $this->_prepareItems($items);
        if (empty($items)) {
            return '';
        }

        list($config, $attrs) = $this->_prepareOptions($config);
        $this->_rendering = true;
        $this->countItems($items);
        $this->config($config);

        if ($this->config('breadcrumbGuessing')) {
            $this->Link->config(['breadcrumbGuessing' => $this->config('breadcrumbGuessing')]);
        }

        $out = '';
        if (intval($this->config('split')) > 1) {
            $out .= $this->_renderPart($items, $config, $attrs);
        } else {
            $out .= $this->formatTemplate('root', [
                'attrs' => $this->templater()->formatAttributes($attrs),
                'content' => $this->_render($items)
            ]);
        }

        if ($this->config('beautify')) {
            include_once Plugin::classPath('Menu') . 'Lib/htmLawed.php';
            $tidy = is_bool($this->config('beautify')) ? '1t0n' : $this->config('beautify');
            $out = htmLawed($out, compact('tidy'));
        }

        $this->_clear();

        return $out;
    }