-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added a new best practices for custom form field types #5093
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
Conversation
javiereguiluz
commented
Mar 19, 2015
Q | A |
---|---|
Doc fix? | no |
New docs? | yes |
Applies to | all |
Fixed tickets | #5077 |
|
||
Add the ``app.`` prefix to your custom form field types to avoid collisions. | ||
|
||
Custom form field types extend from the ``AbstractType`` class, which defines the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"extend the" or "inherit from" I guess.
|
||
.. best-practice:: | ||
|
||
Add the ``app.`` prefix to your custom form field types to avoid collisions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dots are forbidden in type names, so your suggestion is really bad. Recommend app_
instead.
for reference, type names are validated as /^[a-z0-9_]*$/i
I see a little problem here: We already have quite a few best practices just recommending an I think it is better if we just replace all these best practice with one best practice: Always prefix with What's your opinion about this? |
@wouterj I hear what you're saying, it might not be a bad idea. But what are the places we prefix? I can think of:
I'm probably missing a few, but I'm not sure. |
I've merged this in - there was no disagreement here or on the issue, and I can't think of why there would be any. But @wouterj, I don't want to lose your point - so please reply and we can definitely reformat how we're communicating the best practices. Javier, I updated #5077's description to have 2 checkboxes - the second one is to update the documentation to add the app_ prefix. Thanks! |
…(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