summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-03-20 20:03:54 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-03-21 13:36:50 +0100
commit4e500dd1a91008c54e8560a6e35f38530edb52bb (patch)
treea186c05683bb91e0bef3c7f34874263c45f3a00b /config
parent4dfafc5910baec90c9bc58aa61c1103dd41f13fe (diff)
add navigation in closure
Diffstat (limited to 'config')
-rw-r--r--config/appconfig.php34
1 files changed, 18 insertions, 16 deletions
diff --git a/config/appconfig.php b/config/appconfig.php
index 9b3f80a1d..bef117da9 100644
--- a/config/appconfig.php
+++ b/config/appconfig.php
@@ -96,22 +96,24 @@ class AppConfig {
*/
public function registerNavigation() {
if (array_key_exists('navigation', $this->config)) {
- $nav =& $this->config['navigation'];
-
- $navConfig = [
- 'id' => $this->config['id'],
- 'order' => $nav['order'],
- 'name' => $nav['name']
- ];
-
- $navConfig['href'] = $this->urlGenerator->linkToRoute(
- $nav['route']
- );
- $navConfig['icon'] = $this->urlGenerator->imagePath(
- $this->config['id'], $nav['icon']
- );
-
- $this->navigationManager->add($navConfig);
+ $this->navigationManager->add(function () {
+ $nav =& $this->config['navigation'];
+
+ $navConfig = [
+ 'id' => $this->config['id'],
+ 'order' => $nav['order'],
+ 'name' => $nav['name']
+ ];
+
+ $navConfig['href'] = $this->urlGenerator->linkToRoute(
+ $nav['route']
+ );
+ $navConfig['icon'] = $this->urlGenerator->imagePath(
+ $this->config['id'], $nav['icon']
+ );
+
+ return $navConfig;
+ });
}
}