Skip to content

Documented all form variables #3588

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

Merged
merged 15 commits into from
Mar 9, 2014
Merged

Documented all form variables #3588

merged 15 commits into from
Mar 9, 2014

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Feb 18, 2014

Q A
Doc fix? no
New docs? yes
Applies to 2.3+
Fixed tickets #2372

This PR adds all missing global form variables to the twig reference.

Besides that, it also introduces a new section for form types: Form
Variables. This explains what kind of variables are available for that
particular field. This is usefull if you want to create a custom theme.

At last, it also adds the missing docs for the selectedchoice Twig
test.

@lyrixx
Copy link
Member

lyrixx commented Feb 18, 2014

Very nice . good job.

+------------------------+-------------------------------------------------------------------------------------+
| Variable | Usage |
+========================+=====================================================================================+
| ``form`` | The current FormView instance |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put FormView into literals or maybe use an api link here

@weaverryan
Copy link
Member

This is great! But, the tables are a little bit inconsistent - some using all === (collection) and others not (date). @wouterj I don't think this was on purpose, but let me know - I'm not usually the one who finds things like this ;).

Then we'll merge it in - it's awesome!

@wouterj
Copy link
Member Author

wouterj commented Mar 8, 2014

@wouterj I don't think this was on purpose, but let me know - I'm not usually the one who finds things like this ;).

Hehe, it's not inconsistent if you know the idea behind it :) So let me explain it: I always prefer to use the === format for tables, but there is one drawback on this format: It doesn't allow to create multiline rows, since each new line is a new row. If a table needs multilines, I switch to the +---+ notation.

I think we should just merge this in and if you think we should always be consistent, I'll create another PR updating === to +--+ in the docs.

Btw, funny you missed this inconsistency completely when reviewing #3438 😉

@weaverryan
Copy link
Member

No, the little consistencies aren't normally my strong point :). Thanks again for this!

weaverryan added a commit that referenced this pull request Mar 9, 2014
This PR was merged into the 2.3 branch.

Discussion
----------

Documented all form variables

| Q   | A
| --- | ---
| Doc fix? | no
| New docs? | yes
| Applies to | 2.3+
| Fixed tickets | #2372

This PR adds all missing global form variables to the twig reference.

Besides that, it also introduces a new section for form types: Form
Variables. This explains what kind of variables are available for that
particular field. This is usefull if you want to create a custom theme.

At last, it also adds the missing docs for the `selectedchoice` Twig
test.

Commits
-------

7710429 Made full stop usage consistent
398d23f Applied comments by @xabbuh
97d216d Documented TimeType variables
8b5ecf9 Documented SubmitType variables
688409e Documented MoneyType variables
a811833 Documented FileType variables
e5fded9 Documented date_pattern variable of DateType
1a1497c Extracted duplicated var tables
95540ca Documented Date(Time)Type variables
3bfdc20 Documented CollectionType variables
754da30 Added performance tip
7d10315 Documented selectedchoice test
c8a44ae Documented choice variables
98e828f Documented checked variable
d2b57be Documented missing FormType variables
@weaverryan weaverryan merged commit 7710429 into symfony:2.3 Mar 9, 2014
@wouterj wouterj deleted the issue_2372 branch March 9, 2014 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants