Commit 8f8e8ff7 authored by Tim Steiner's avatar Tim Steiner
Browse files

In the WdnTemplate helper, allow a link to be defined as a string in addition...

In the WdnTemplate helper, allow a link to be defined as a string in addition to the existing array definition.
parent c33a6449
......@@ -185,14 +185,20 @@ EOF;
}
$html = '<ul>' . PHP_EOL;
foreach ($links as $link) {
$html .= '<li>'
. (isset($link['href']) ? '<a href="' . $this->_processUrl($link['href']) . '">' : '')
. $link['text']
. (isset($link['href']) ? '</a>' : '');
if (isset($link['children'])) {
$html .= PHP_EOL . $this->_processLinks($link['children']);
}
$html .= '</li>' . PHP_EOL;
if (is_array($link)) {
$html .= '<li>'
. (isset($link['href']) ? '<a href="' . $this->_processUrl($link['href']) . '">' : '')
. $link['text']
. (isset($link['href']) ? '</a>' : '');
if (isset($link['children'])) {
$html .= PHP_EOL . $this->_processLinks($link['children']);
}
$html .= '</li>' . PHP_EOL;
} else {
$html .= '<li>'
. $link
. '</li>' . PHP_EOL;
}
}
$html .= '</ul>' . PHP_EOL;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment