-
Notifications
You must be signed in to change notification settings - Fork 76
[WIP] use conditional enhancer #349
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
Conversation
| ->useAttributeAsKey('class') | ||
| ->prototype('scalar')->end() | ||
| ->prototype('array') | ||
| ->ignoreExtraKeys(false) |
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.
This one was the only chance to get a nested array without an own key, but now i got no validation on deeper key names (value, methods) anymore.
| } | ||
|
|
||
| if (0 < count($enhancerMap)) { | ||
| $container->getDefinition('cmf_routing.enhancer.conditional')->addArgument([]);#$enhancerMap); |
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.
HI @wouterj
can you give me some help here, or just an advise. @dbu and i cam to the solution of an condional enhancer (symfony-cmf/Routing#174) to handle method aware configuration. This one should get an enhancer map as created some lines above. This map unfortunatly contains objects, so i can't inject them as an argurment of a DI service defintion. You have an idea how to pass them in? One idea is to use an array only and build the object based map inside the enhancers constructor, which means to change that one in routing component, you have an other idea?
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.
symfony-cmf/Routing#175 would be my solution. I also added a position value, to re-add the former position values (service defintions in extension class) for a same source/target sitiuation.
| if (is_array($item)) { | ||
| $items[$key]['value'] = trim($item['value']); | ||
| } else { | ||
| $items[$key] = trim($item); |
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.
@wouterj do you know why we need to trim here? xml configuration ease of use?
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.
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.
its indeed the xml configuration. we have tests making sure that controllers with whitespace around them do work. surprised though that this is not in the Configuration class instead.
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.
by the normalizer, right?
Am 21.05.2016 um 09:54 schrieb David Buchmann:
In DependencyInjection/CmfRoutingExtension.php
#349 (comment):@@ -82,7 +87,20 @@ private function setupDynamicRouter(array $config, ContainerBuilder $container,
$loader->load('routing-dynamic.xml');// strip whitespace (XML support)
foreach (array('controllers_by_type', 'controllers_by_class', 'templates_by_class', 'route_filters_by_id') as $option) {foreach (array('controllers_by_type', 'controllers_by_class', 'templates_by_class') as $option) {$config[$option] = array_map(function ($items) {foreach ($items as $key => $item) {if (is_array($item)) {$items[$key]['value'] = trim($item['value']);} else {$items[$key] = trim($item);its indeed the xml configuration. we have tests making sure that
controllers with whitespace around them do work. surprised though that
this is not in the Configuration class instead.—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/symfony-cmf/routing-bundle/pull/349/files/5964ebe6047f649f9defc57b686e0bc169b17213#r64130892
|
ok if we postpone this to later than 2.0? as long as its BC, it can be in 2.1 or whenever we are ready |
|
will keep track localy, maybe. |
…od configuration
So this ist is first step. Need to do: