Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Allow path providers that don't add path elements each time #47

Merged
merged 1 commit into from
Dec 21, 2013

Conversation

sroze
Copy link
Contributor

@sroze sroze commented Dec 18, 2013

This PR allow path providers to don't add path elements on each RouteStack objects.
This simply allow an empty path for RouteStacks.

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets None.
License MIT
Doc PR None. But could be great to create a doc about custom path providers.

@dantleech
Copy link
Member

Hi @sroze - what is the use case for this?

@sroze
Copy link
Contributor Author

sroze commented Dec 18, 2013

Hi @dantleech . The use case can be (and that's mine) for a custom path provider that add an url prefix in case of the content has a non-empty attribute. If this attribute is empty (and in my case it is possible) the provider don't add any path element.

@dantleech
Copy link
Member

@sroze
Copy link
Contributor Author

sroze commented Dec 18, 2013

Added tests and squashed.

@dantleech
Copy link
Member

cool, nice work! @dbu @wouterj does this make sense to you?

For the documentation I created an issue: symfony-cmf/symfony-cmf-docs#357

@wouterj has refactored the docs for this bundle (https://github.com/symfony-cmf/symfony-cmf-docs/pull/353/files#diff-9832a4ffd030208d93ebf8eab4826451R4), so probably better to wait until that is merged before documenting this feature.

@dbu
Copy link
Member

dbu commented Dec 19, 2013

@dantleech you have the vision for this bundle, so you have the final call on merging imo.

but i think its a cool improvement and i see the use cases.

@@ -16,6 +16,12 @@ public function setUp()
$this->route2 = new \stdClass;
}

public function testGetEmptyPath ()
Copy link
Member

Choose a reason for hiding this comment

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

remove space before ()

@wouterj
Copy link
Member

wouterj commented Dec 19, 2013

Yeah, sounds good to me. +1

dantleech added a commit that referenced this pull request Dec 21, 2013
Allow path providers that don't add path elements each time
@dantleech dantleech merged commit ff8f3a8 into symfony-cmf:master Dec 21, 2013
@dantleech
Copy link
Member

@sroze thanks! fyi it helps if you always add a comment after pushing a new commit, as we are not automatically notified when new commits are added.

@sroze sroze deleted the empty-pathprovider branch December 22, 2013 18:45
@sroze
Copy link
Contributor Author

sroze commented Dec 22, 2013

@dantleeck, i'll do that the next time. Thanks !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants