doc: Render chapter tab titles human readable

This commit is contained in:
Eric Lippmann 2016-04-01 14:38:23 +02:00
parent 3ecf390a4b
commit 48cd99aba3
1 changed files with 7 additions and 2 deletions

View File

@ -46,10 +46,15 @@ class DocController extends Controller
->setImageUrl($imageUrl)
->setUrl($url)
->setUrlParams($urlParams);
$this->view->title = $chapter;
$first = null;
foreach ($section as $first) {
break;
}
$title = $first === null ? ucfirst($chapter) : $first->getTitle();
$this->view->title = $title;
$this->getTabs()->add('toc', array(
'active' => true,
'title' => ucfirst($chapter),
'title' => $title,
'url' => Url::fromRequest()
));
$this->render('chapter', null, true);