Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

new cookbook article on using empty data for form classes#2415

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 1 commit intosymfony:2.0fromjoelclermont:issue_998
Apr 4, 2013

Conversation

joelclermont
Copy link
Contributor

QA
Doc fix?yes
New docs?yes (symfony/symfony#1140)
Applies toall
Fixed tickets#998

I'd like some feedback on my cookbook article for both accuracy and formatting. I am working on linking this cookbook article from the form class section of the documentation, as well as the two form types (choice and collection) that use the empty_data option. Those are both relevant, correct?


Option 1: instantiate a new class:

.. code-block:: php
Copy link
Member

Choose a reason for hiding this comment

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

Let me teach you some harder Shpinx formatting:

Instead of

lorem ipsum, see this example:..code-block::php    // ... some PHP code

You can use:

lorem ipsum, see the example::    // ... some PHP code

(notice the double colon at the end). Both are rendered the same (as code defaults to PHP on Symfony.com) and we prefer the last one.

@joelclermont
Copy link
ContributorAuthor

Thanks for the feedback. I will send an updated PR shortly. I'll also include some of the additional documentation linking to this cookbook article.

@joelclermont
Copy link
ContributorAuthor

Ok, ready for another review. I've made the changes you requested and added a cross-reference link from the element-level empty_data section.

I didn't think it made sense to link from the form classes section. It didn't talk aboutgetDefaultOptions() at all, so I thought it would be weird to mention this one option there. Let me know if this looks good.

@@ -11,3 +11,4 @@ Form
create_custom_field_type
create_form_type_extension
use_virtuals_forms
use_empty_data
Copy link
Member

Choose a reason for hiding this comment

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

you should add the newline at the end IMO to avoid extra diffs (and associated conflicts) when adding another line in the file

@stof
Copy link
Member

As there is nothing specific to the framework here, the Form component may be a better place than the cookbook. But it would also apply to the article about the virtual forms.@weaverryan what do you think ?

single: Form; Empty data

How to configure Empty Data for a Form Class
===============================================
Copy link
Member

Choose a reason for hiding this comment

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

some= to much

@weaverryan
Copy link
Member

@stof It's not always easy to write something that's useful that doesn't "couple" itself to the framework, but in this case, it's happened accidentally.

Buuut, we don't have the form component yet. So I think the only thing to do is keep it in the cookbook and move things later on.

@joelclermont
Copy link
ContributorAuthor

Fixed the missing line break at end of file and the extra = under the heading.


If you want to override this default behavior, there are two ways to do this.

**Option 1**: instantiate a new class::
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to use sections in the article?

Option 1: Instantiate a new Class---------------------------------One reason you might use option 1 [...]..code-block::php     // ...

@wouterj
Copy link
Member

👍

weaverryan added a commit that referenced this pull requestApr 4, 2013
new cookbook article on using empty data for form classes
@weaverryanweaverryan merged commite93ccf1 intosymfony:2.0Apr 4, 2013
@joelclermontjoelclermont deleted the issue_998 branchApril 4, 2013 01:27
weaverryan added a commit that referenced this pull requestApr 4, 2013
@weaverryan
Copy link
Member

Hi Joel!

Really really wonderful work here - and it's such a nice topic. I've merged this into the 2.0 branch and added some additional examples at sha:87c0536. Please let me know if you see anything you don't like (and excuse my User -> Post change, I started adding details then only later saw that you were using a User example - both are perfectly fine).

I also merged this into the 2.1 branch and made the needed changes at sha:0d62bfc

Thanks Joel!

@joelclermont
Copy link
ContributorAuthor

The additions look nice! Thanks for the merge.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@joelclermont@stof@weaverryan@wouterj

[8]ページ先頭

©2009-2025 Movatter.jp