Skip to content

Commit

Permalink
add query to menu entry
Browse files Browse the repository at this point in the history
  • Loading branch information
maxgu committed Dec 2, 2015
1 parent d11d86c commit 983057e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/T4webNavigation/Menu/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ class Entry
*/
private $icon;

function __construct($label, $route, $icon = '', $params = [])
/**
* @var array
*/
private $query;

function __construct($label, $route, $icon = '', $params = [], $query = [])
{
$this->label = $label;
$this->route = $route;
$this->icon = $icon;
$this->params = $params;
$this->query = $query;
}

/**
Expand Down Expand Up @@ -72,4 +78,12 @@ public function getIcon()
return $this->icon;
}

/**
* @return array
*/
public function getQuery()
{
return $this->query;
}

}
2 changes: 2 additions & 0 deletions src/T4webNavigation/Menu/Navigator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ private function prepare(array $config)
'label' => $entry->getLabel(),
'route' => $entry->getRoute(),
'params' => $entry->getParams(),
'query' => $entry->getQuery(),
'icon' => $entry->getIcon()
];

Expand All @@ -54,6 +55,7 @@ private function prepare(array $config)
'label' => $subEntry->getLabel(),
'route' => $subEntry->getRoute(),
'params' => $subEntry->getParams(),
'query' => $entry->getQuery(),
'icon' => $subEntry->getIcon()
];
}
Expand Down

0 comments on commit 983057e

Please sign in to comment.