Skip to content

Commit

Permalink
Added ability to override controller action links’ text using label.
Browse files Browse the repository at this point in the history
  • Loading branch information
drmonkeyninja committed Feb 4, 2016
1 parent e82c7b3 commit a7c16eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Listener/ViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,17 @@ protected function _getControllerActions()
$scope = isset($config['scope']) ? $config['scope'] : 'entity';
$method = isset($config['method']) ? $config['method'] : 'GET';

$title = !empty($config['label']) ? $config['label'] : Inflector::humanize(Inflector::underscore($actionName));

${$scope}[$actionName] = [
'title' => Inflector::humanize(Inflector::underscore($actionName)),
'title' => $title,
'url' => [
'action' => $actionName
],
'method' => $method,
'options' => array_diff_key(
$config,
array_flip(['method', 'scope', 'className'])
array_flip(['method', 'scope', 'className', 'label'])
)
];
if (!empty($config['callback'])) {
Expand Down

0 comments on commit a7c16eb

Please sign in to comment.