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

[RFC] Add a make:form:type-extension command #78

Open
yceruto opened this issue Dec 1, 2017 · 7 comments
Open

[RFC] Add a make:form:type-extension command #78

yceruto opened this issue Dec 1, 2017 · 7 comments
Labels
Feature New Feature RFC

Comments

@yceruto
Copy link
Member

yceruto commented Dec 1, 2017

Hi guys!

This maker command would generates a new (form) type extension class under src/Form/Extension/ and the argument is the extended type class (the class name is derived from it).

What do you think?

@javiereguiluz
Copy link
Member

I guess it's OK to add this maker. About the naming, we need to carefully think about this (not only for this proposal, but for others).

At first we thought we could use this syntax: make : xxx (e.g. make:twig-extension) to avoid the boring triple namespace (make:twig:extension). It's great because it's short. And for cases like Twig, it's the best option because we won't generate anything related to Twig except the extension, so there won't be more make:twig:xxx.

However, for things like auth, we are planning to do make:auth:xxx so maybe we cannot escape from the triple namespace curse. In summary, we already have make:form; if we add this command, what's the best name for it?

make:form:extension
make:form-extension

I'd remove the type- part in all cases because in Symfony Forms, extensions can only be about "types", so it's redundant.

@stof
Copy link
Member

stof commented Dec 1, 2017

I'd remove the type- part in all cases because in Symfony Forms, extensions can only be about "types", so it's redundant.

that's not true. The component has both a FormExtension and a FormTypeExtension (but the FormExtension is not that used, as we rely on the DependencyInjectionExtension in any project using FrameworkBundle, and we configure this extension instead).

@stof
Copy link
Member

stof commented Dec 1, 2017

Regarding the naming, I don't think the type extension should be named based on the type it extends. You can have many type extensions extending the same type.
Naming them based on the feature they add is much better.

@yceruto
Copy link
Member Author

yceruto commented Dec 1, 2017

You can have many type extensions extending the same type. Naming them based on the feature they add is much better.

@stof Good point! I agree.

So, it should be named make:form-type-extension? i.e to avoid the triple namespace?

@yceruto
Copy link
Member Author

yceruto commented Dec 4, 2017

See #85

@gabiudrescu
Copy link

any chance this can be revived?

If I provide an implementation based on the initial implementation from @yceruto can this be merged to master?

@weaverryan
Copy link
Member

I would be 👍 for having this maker :) The original PR was just SO early in Maker dev, that we changed a bunch of stuff and broke that PR :/.

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

Successfully merging a pull request may close this issue.

5 participants