symfony-cmf / Routing

Routing component building on the Symfony Routing component
Other
288 stars 69 forks source link

Force absolute url generation depending on route host #112

Closed EmmanuelVella closed 10 years ago

EmmanuelVella commented 10 years ago

Hi,

I my MultiDomainBundle I need to generate absolute url if the route host is different from the context host.

Is it possible to include this feature in this library ?

I open my PR for the 1.2 branch, hope it's ok.

lsmith77 commented 10 years ago

looks good to me .. @dbu ?

dbu commented 10 years ago

definitely seems wrong if this is not working.

but i am surprised that this does not already work as expected. this should not be cmf specific but symfony in general would do it. do you see why https://github.com/symfony/symfony/blob/397687f345f4ea83f344a54275f4bc328ac2d4b4/src/Symfony/Component/Routing/Generator/UrlGenerator.php#L253-L258 would not trigger? or is that something fixed after symfony 2.3? i would be -1 on adding a workaround for a symfony issue that is fixed in 2.4+ could that be the reason?

could you add a test for this case, and check if without your change it works on 2.4+ but fails on 2.3?

EmmanuelVella commented 10 years ago

hum yes you are right it should be handle by symfony. I'm going to check this again.

dbu commented 10 years ago

thanks a lot. if cmf does something wrong, i would consider it a bug so the 1.2 branch seems right.

lsmith77 commented 10 years ago

@tobion do you have a hint here?

EmmanuelVella commented 10 years ago

@dbu You were right, it's perfectly working. The protocol relative url format (//) misled me !