public function link($name, $url = '', array $options = [], array $linkOptions = []) {
        $url = $this->Url->build($url);
        $options += [
            'active' => [],
            'templateVars' => []
        ];
        $linkOptions += [
            'templateVars' => []
        ];
        if (is_string($options['active'])) {
            $options['active'] = [];
        }
        if ($this->getConfig('autoActiveLink') && is_array($options['active'])) {
            $options['active'] = $this->compareUrls($url, null, $options['active']);
        }
        $active = $options['active'] ? 'Active' : '';
        $level = $this->_level > 1 ? 'inner' : 'outer';
        $template = $level.'MenuItem'.$active;
        $linkTemplate = $level.'MenuItemLink'.$active;
        $link = $this->formatTemplate($linkTemplate, [
            'content' => $name,
            'url' => $url,
            'attrs' => $this->templater()->formatAttributes($linkOptions),
            'templateVars' => $linkOptions['templateVars']
        ]);
        return $this->formatTemplate($template, [
            'link' => $link,
            'attrs' => $this->templater()->formatAttributes($options, ['active']),
            'templateVars' => $options['templateVars']
        ]);
    }