-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow merge router, controller and action configuration #183
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,10 +238,15 @@ public function setupRenderer(Renderer $renderer) | |
{ | ||
$controllerConfig = $this->getControllerConfig(); | ||
$actionConfig = $this->getActionConfig(); | ||
$routerConfig = $this->getRouterConfig(); | ||
|
||
$config = array_merge($controllerConfig, $actionConfig); | ||
|
||
if (count($config) == 0) { | ||
$config = $this->getRouterConfig(); | ||
$mergeConfigs = $this->configuration->canMergeActionAndRouterConfig(); | ||
if ($mergeConfigs) { | ||
$config = array_merge($routerConfig, $config); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How would you verify that merging returns the expected result? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use this in my project on production and all works as expected. |
||
} elseif (count($config) == 0) { | ||
$config = $routerConfig; | ||
} | ||
|
||
// If we don't have any assets listed by now, or if we are mixing in | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent potential regression in future releases, I will ask you to test that default configuration is set to
false
.Test class for this file can be found here:
https://github.com/widmogrod/zf2-assetic-module/blob/master/tests/AsseticBundleTest/Configuration.php