-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[Waiting Code Merge] Introduction chapter for the Form component #1883
Conversation
->getFormFactory(); | ||
|
||
TODO: Cross reference the HTTP foundation chapter where the configuration of the | ||
Templating component is explained. |
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.
This sentence looks weird
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.
it's a TODO note anyway... ;)
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.
why it looks weird @stof ?
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.
HTTP foundation chapter
vs Templating component is explained
So far the differences between standalone and within the framework usage have been dealt with by documenting the standalone way in the component section and then linking to cookbook pages which show differences in framework specific usages. Whether this is the approach here or you have you the framework specific code blocks, there is still a general issue with people not realising that the components section contains details relevant even if you are using the framework. |
@richardmiller Yes. My idea is to make the form chapter in the book more or less the equivalent of this introduction chapter (only without the component-specific parts) and to link from there to the other chapters of the component docs. I.e., the component chapter "Introduction" and the book chapter "Forms" will give info about how to get started, and the other chapters in the component docs will give more information for both framework and non-framework users. What do you think about this? |
Sounds good, would be in keeping with other component sections where the more detailed documentation is now in the component section. Some of the cookbook pages can possibly moved to the component section with just framework specific parts being kept in the cookbook. If the new blocks are introduced then it will remove the need for the cookbook pages specifying the differences especially where they are minor. It does mean a change in thinking about keeping framework specific info out of the components section though. |
I guess we need to find out whether this works anyway. Some more ideas on how to make this work:
ping @fabpot |
I am really +1 with the cookie. |
Hi guys! Using the tabbed code blocks to handle framework vs standalone docs is much different than what we do now. But, we're always in the process of trying, refining and improving. My first impression is that these blocks are a bit more clear than I expected, and since we don't have any form component docs right now, I think this is the right place to try it. Making the changes needed to the Here are things that will take more work (which would need to be done by @fabpot). Since we're experimenting still, I don't think these things need to happen immediately anyways:
@bschussek I'll see if I can take your document and work it over (proofread it, add more content where needed etc) by this weekend - then we should have something we could merge in :). @fabpot If you disagree or have any major concerns with trying to put the framework versus component code into Thanks everyone! |
For the PDF, and even if this is more work, I prefer @bschussek idea, where the user selects which tab he wants to have in the book. I don't like the idea of putting all sections in the PDF as it will become a mess pretty fast with pages after pages of code. But then, what about the printed book? We don't have one yet, but as people ask for it, we will probably have to publish a paper book at some point. |
@weaverryan No problem for the adding of new possible sections under the |
If we do this we have to find out how to deal with tabs of different length. I.e., if I switch the tab of conf-block 3 on a page, and blocks 1 and 2 switch automatically but to a tab of a different length, the view will "jump".
I think the most viable option is to choose one combination for the book and point out in the introduction that the user may find the code samples of the alternatives online. |
@weaverryan Thanks, very appreciated!! |
->getFormFactory(); | ||
|
||
To secure your application against CSRF attacks, you need to define a CSRF | ||
secret. Generate a random string with at least 32 characters, insert it in 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.
secret number or string parameter, although it is obvious but more proper
|
||
The Form component comes with tight (but optional) integration with Symfony's | ||
Validator component. If you're using a different solution for validation, | ||
no problem! Simply take the bound data of your form (which is an array or |
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.
"bound" -> "submitted". In this chapter, people don't really know yet what "binding" refers to.
@weaverryan I added my comments inline. As for your questions:
Yes, but I'd like to defer the detailed explanation for this to the "Templating" or "Rendering" chapter of the component docs. Once we have this, we can add a note here.
Yes, I think the references in general need to be improved. Should we create a list with the todos we're identifying here and store it somewhere?
We can decide what to do with the form chapter when we finished the component docs. Then we'll see whether this whole plan works out or not. :) In general I like your additions very much! I think they are very clear and well formulated! (and much better than I could have done) Thanks Ryan!! I'll reread this tonight or tomorrow and try to give some more feedback. |
public function newAction(Request $request) | ||
{ | ||
// createFormBuilder is a shortcut to get the "form factory" | ||
// and then call "createBuilder" on it |
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.
I think this should be "createBuilder()". Names of methods in the text of the documentation also always include the parentheses.
Hi @bschussek! I've made the changes you suggested and fixed a few other things! I've also made a PR to Sorry for the delay on my end. What are the next steps from here? Thanks! |
…is directory is just one option
…omehow important internally
Btw, we're waiting for the code merge of fabpot/sphinx-php#3 and then we'll merge this in. |
what is the status of this @fabpot |
@fabpot and @weaverryan, is there any progress on this one? I'd like to move this forward, so we can create more form component articles (e.g. the empty_data article written by Joel and the form_collections article I'm going to write) |
What about removing the special code blocks from this PR (only use php-standalone) and putting that special blocks inside a new PR? IMO, this is one of the most wanted missing docs and it's stupid (note: this is not negative meaned, I just couldn't find the correct word) to not merge such it because of some experimental thing. @weaverryan @bschussek |
+1 I think that's a very pragmatic idea. @bschussek if you have time and agree, do it! Otherwise, I'll handle it shortly. |
ping @bschussek @weaverryan |
@bschussek you're now back, so my last ping 🌕 ;-) |
I'd prefer to get fabpot/sphinx-php#3 merged, otherwise we'll remove the duplicate blocks now and add them in again later - too much unnecessary work for my taste. |
fabpot/sphinx-php#3 has just been merged! |
@wouterj This should be ready to merge now :) |
yeah, yeeh! 🎈 ping @weaverryan |
[Waiting Code Merge] Introduction chapter for the Form component
Woot! Merged! Now we'll see how this look and continue to experiment. Cheers! |
Just a question, shouldn't the code examples use |
|
@ggam You are correct. The chapter needs to be updated for versions >2.1. If you have time, please open a PR! :) |
I made the necessary changes for |
This PR is WIP. It contains the sketch for an introduction chapter of a new Form section in the components book. This section is dedicated to:
I want to achieve both aspects at once by introducing two new configuration blocks:
The differences between code in these two formats is in most cases minimal.
@fabpot: What do you think about this? Could you adapt your Sphinx extension accordingly?
@weaverryan: Do you want to write the accompanying text to the code samples? (where missing)
everyone: Is anything essential missing in this chapter?