Skip to content

Conversation

@ElectricMaxxx
Copy link
Member

@ElectricMaxxx ElectricMaxxx commented May 2, 2016

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets symfony-cmf/Routing#171

…od configuration

So this ist is first step. Need to do:

  • implement change on routing conditional enhancer Routing#174
  • add xml schma changes
  • use conditional enahncer and create its enhancer map
  • let configuration work
  • remove single enhancers as tagged services, that ones that goes into the conditional enhancer

@ElectricMaxxx ElectricMaxxx changed the title change controller_by_class configuration to get a action by http meth… [WIP] change controller_by_class configuration to get a action by http meth… May 2, 2016
@ElectricMaxxx ElectricMaxxx changed the title [WIP] change controller_by_class configuration to get a action by http meth… [WIP] use conditional enhancer May 13, 2016
->useAttributeAsKey('class')
->prototype('scalar')->end()
->prototype('array')
->ignoreExtraKeys(false)
Copy link
Member Author

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);
Copy link
Member Author

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?

Copy link
Member Author

@ElectricMaxxx ElectricMaxxx May 15, 2016

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);
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

Copy link
Member Author

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

@dbu dbu modified the milestone: 2.0 Jun 14, 2016
@dbu
Copy link
Member

dbu commented Nov 22, 2016

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

@ElectricMaxxx ElectricMaxxx modified the milestones: 2.1, 2.0 Nov 28, 2016
@ElectricMaxxx
Copy link
Member Author

will keep track localy, maybe.

@dbu dbu deleted the rest_routes_on_controller_by_class branch October 22, 2020 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants