getHelper('Url'); $view = $this; ?>
[^>]*?\s+)?href="#(?P[^"]+)"/im', function($match) use ($toc, $moduleName, $urlHelper, $view) { if (($node = $toc->findNodeBy(function ($node) use ($match) { $section = $node->getValue(); if (($section->id === null && $section->chapterName === $match['fragment']) || $section->id === $match['fragment'] ) { return true; } return false; }))) { $section = $node->getValue(); $path = $urlHelper->url( array('moduleName' => $moduleName, 'chapterName' => $section->chapterName), 'doc/module/chapter', false, false ); $url = $view->url($path); if ($section->id) { $url->setAnchor($section->id); } return sprintf( 'nofollow ? 'rel="nofollow" ' : '', $url->getAbsoluteUrl() ); } return $match[0]; }, $chapterHtml ); ?>