Skip to content

New best-practice for Symfony Forms #5077

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

Closed
2 tasks done
javiereguiluz opened this issue Mar 12, 2015 · 6 comments
Closed
2 tasks done

New best-practice for Symfony Forms #5077

javiereguiluz opened this issue Mar 12, 2015 · 6 comments
Labels
actionable Clear and specific issues ready for anyone to take them. good first issue Ideal for your first contribution! (some Symfony experience may be required)

Comments

@javiereguiluz
Copy link
Member

In #5076 we've reworded an important note as follows:

The ``getName()`` method returns the identifier of this form "type". These
identifiers must be unique in the application. Unless you want to override
a built-in type, they should be different from the default Symfony types
and from any type defined by a third-party bundle installed in you application.
Consider prefixing your types with ``app_`` to avoid identifier collisions.

Should we make the app_ prefix recommendation a formal best practice?

@xabbuh
Copy link
Member

xabbuh commented Mar 12, 2015

Same question as in #5076: Should we use app. instead to be consistent with service name recommendations?

Besides that I like this idea. 👍

@stof
Copy link
Member

stof commented Mar 19, 2015

@xabbuh dots are forbidden in type names, so the answer is no

@weaverryan
Copy link
Member

👍

weaverryan added a commit that referenced this issue Mar 24, 2015
…(javiereguiluz)

This PR was merged into the 2.3 branch.

Discussion
----------

Added a new best practices for custom form field types

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | all
| Fixed tickets | #5077

Commits
-------

0696daf Fixed errors, typos and grammar issues. (I managed to fail at everything!)
8eb1240 Added a new best practices for custom form field types
@weaverryan weaverryan added good first issue Ideal for your first contribution! (some Symfony experience may be required) actionable Clear and specific issues ready for anyone to take them. and removed needs comments labels Mar 24, 2015
@weaverryan
Copy link
Member

I've just merged this in and updated the description to have a todo to add the app_ prefix to all the existing form types on the docs.

@snoek09
Copy link

snoek09 commented Jan 5, 2016

Part B is done so this can be closed, right?

@xabbuh
Copy link
Member

xabbuh commented Jan 5, 2016

You are right @snoek09.

@xabbuh xabbuh closed this as completed Jan 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. good first issue Ideal for your first contribution! (some Symfony experience may be required)
Projects
None yet
Development

No branches or pull requests

5 participants