Skip to content
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

[Form] form add extra data #20853

Open
wants to merge 6 commits into
base: 6.4
Choose a base branch
from
Open

Conversation

Arkalo2
Copy link

@Arkalo2 Arkalo2 commented Apr 2, 2025

No description provided.

@Arkalo2 Arkalo2 requested a review from xabbuh as a code owner April 2, 2025 13:22
@carsonbot carsonbot added this to the 7.3 milestone Apr 2, 2025
@Arkalo2
Copy link
Author

Arkalo2 commented Apr 2, 2025

The getExtraData function exist long time ago, I don't know which version I should base this pull request.

@xabbuh xabbuh modified the milestones: 7.3, 6.4 Apr 3, 2025
@MrYamous
Copy link
Contributor

MrYamous commented Apr 4, 2025

The getExtraData function exist long time ago, I don't know which version I should base this pull request.

You can use 6.4 as it's the oldest maintained branch.

{{ form_row(form.email) }}

{# Hidden field to send additional referral code #}
<input type="hidden" name="user_create[referralCode]" value="{{ referralCode }}"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

isnt it usefull to also add a note on from where this "user_create" value comes from?
as it is a "niche feature" I would assume one knows but just in case ^^

Copy link
Author

Choose a reason for hiding this comment

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

A note to explain user_create is the name of the form?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes because it will only works of this handwritten name is correct according to symfony way of doing right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

I added description, what do you thinks ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I like it, much more precise imho

Copy link
Member

@yceruto yceruto Apr 8, 2025

Choose a reason for hiding this comment

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

or you can use {{ form.vars.full_name ~ '[referralCode]' }} to render the form name dynamically

@OskarStark OskarStark added the Form label Apr 4, 2025
@carsonbot carsonbot changed the title form add extra data [Form] form add extra data Apr 4, 2025
@Arkalo2 Arkalo2 force-pushed the form/add-extra-data branch from 8803a0a to 3a9cef5 Compare April 8, 2025 10:20
@Arkalo2 Arkalo2 force-pushed the form/add-extra-data branch from 3a9cef5 to 9fb25a4 Compare April 8, 2025 11:56
@Arkalo2 Arkalo2 changed the base branch from 7.3 to 6.4 April 8, 2025 11:56
@Arkalo2 Arkalo2 force-pushed the form/add-extra-data branch from 9fb25a4 to 522e74c Compare April 8, 2025 12:00
Extra fields
~~~~~~~~~~~~

All form fields are considered properties of the object but you can inject fields directly into your view without specifying them in the form definition.
Copy link
Contributor

Choose a reason for hiding this comment

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

Symfony doc has a rule of max char per line, can you try to mimic a line length above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants