-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Form] Document template variables for each form type #1039
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
Comments
@weaverryan I think this should be documented soon, can you label it with 'Actionable' and 'Missing Documentation'? |
We do cover this, though I don't think as intentionally as we should. In the form chapter, under the |
I think we should put this in the |
I think that's a great suggestion - the "form" chapter section should then just include a link over to the |
👍 for adding all supported vars in a reference guide. Let me give you one very simple example that it not documented anywhere (except in an answer on SO by Bernhard): This should probably be a high priority as this is really easy to document and highly interesting for developers. |
You probably mean if a form "is valid", which is different - ie children included ? |
I've got this going over in #2251 - thanks! |
Closing this as it #2251 is merged |
The usage of forms in templates should be documented properly. People should understand that each form has attached variables which are accessible via
{{ form.vars.<var-name> }}
($form->getVar('<var-name>')
respectively) or, in a form theme, via{{ <var-name> }}
directly ($<var-name>
respectively).Form children, in contrast, are accessed via
{{ form.<child-name> }}
(alternatively{{ form.children.<child-name>
, which is necessary if the child name conflicts with one of the getters in FormView) and via$form['<child-name>']
in PHP templates.For all form types, the available template variables should be documented (for example, in a "For designers" section) thouroughly.
The text was updated successfully, but these errors were encountered: