Skip to content

[#1039] Adding a reference section for the global twig variables #2251

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 2 commits into from
Feb 23, 2013

Conversation

weaverryan
Copy link
Member

Hi guys!

See the discussion on #1039. This adds a reference section for the variables that are available everywhere (but doesn't cover field-specific variables).

We already have a section above this that explains "form variables", and we have a link from the "Form Customizations" cookbook entry to this. If anyone sees any other good places to add a link to this or any ways we can make this more clear, please let me know!

After merging into 2.1, I'll update it with the 2.1 changes.

Q A
Doc fix? yes
New docs? no
Applies to all (then more changes fro 2.1)
Fixed tickets #1039

Thanks!

@wouterj
Copy link
Member

wouterj commented Feb 19, 2013

It is maybe a good idea to put an example of one of the variables in there, as it was not clear how to use these global vars in twig on de IRC channel.

And don't forget the Pull Request format ;-)

| | This only applies to the parent form element. |
+-----------------+-----------------------------------------------------------------------------------------+
| ``attr`` | A key-value array that will be rendered as HTML attributes on the field |
+-----------------+-----------------------------------------------------------------------------------------+
Copy link
Member

Choose a reason for hiding this comment

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

valid and label_attr should also be added in the 2.1 branch.

and you should also mention they can be accessed as form.vars.* too (which is useful when you want to access the variable of a child form)

@weaverryan weaverryan merged commit b774bc2 into 2.0 Feb 23, 2013
@weaverryan weaverryan deleted the form-variables-reference branch February 23, 2013 15:48
@weaverryan
Copy link
Member Author

Thanks guys! I've merged this into 2.0 and then made the changes on 2.1. If you see any issues with the 2.1 changes, please let me know.

Thanks!

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.

3 participants