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 and form generation #2266

Merged

Conversation

pjedrzejewski
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets -
License MIT
Doc PR -

Hey folks, this is something I need for my special Christmas gift, kinda related to Sylius because it will make our life easier, but it should be useful for everyone. :)

This PR adds 2 things:

  • Automatic form generation if it does not exist (currently supports only doctrine/orm)
  • Automatic API routing generation for resources, it is currently just a simple generation and I do not want to use it in Sylius yet, because in case of Sylius we need to customize a lot of things, but wait till Monday to see what cool it can do for simpler use-cases :)

It will be improved and updated with my #2255 Resource bundle refactoring, so fear not about its current state. :P

Cheers,

@pjedrzejewski
Copy link
Member Author

Obviously, we can also make a "normal" routing generator for backend crud actions etc.

$type = $this->config->getFormType();

if (!$this->get('form.registry')->hasType($type)) {
$defaultFormFactory = new DefaultFormFactory($this->container->get('form.factory'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we declare that service as a service ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Shhh, I know, I know, I need it for Christmas! XD

@arnolanglade
Copy link
Contributor

Do it miss some specs :D ?

@pjedrzejewski
Copy link
Member Author

@Arn0d Yeah... I will refactor the whole controller with specs in #2255.

pjedrzejewski pushed a commit that referenced this pull request Dec 19, 2014
@pjedrzejewski pjedrzejewski merged commit 4977874 into Sylius:master Dec 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants