Skip to content
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

Routing option "parent" does not work #93

Closed
beberlei opened this issue Jul 24, 2011 · 3 comments
Closed

Routing option "parent" does not work #93

beberlei opened this issue Jul 24, 2011 · 3 comments
Assignees
Labels

Comments

@beberlei
Copy link
Contributor

The Symfony routing prevents the "parent" attribute from being set through validation and an exception is thrown.

@lsmith77
Copy link
Member

Can you give me an example here?

@ghost ghost assigned everzet Jul 26, 2011
@everzet
Copy link
Member

everzet commented Jul 26, 2011

It seems, that you're trying to load restful route inside default routing configuration. In order to be able to use parent and other rest-specific parameters - you need to move such configs into restful collection.

This is wrong:

# app/config/routing.yml
users:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UsersController

user_topics:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UserTopicsController
  parent:   users

But this is correct:

# app/config/routing.yml
users:
  type: rest
  resource: path/to/your/bundle/routing.yml
# path/to/your/bundle/routing.yml
users:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UsersController

user_topics:
  type:     rest
  resource: FOS\RestBundle\Tests\Fixtures\Controller\UserTopicsController
  parent:   users

@everzet everzet closed this as completed Jul 26, 2011
@stof
Copy link
Member

stof commented Jul 26, 2011

note that you can also load the main file with the type rest by defining the type in your router configuration

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

No branches or pull requests

4 participants