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

Fix upgrade prototype name option #5833

Merged
merged 2 commits into from
Oct 25, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 5 additions & 14 deletions UPGRADE-2.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,22 +423,13 @@
* In the collection type's template, the default name of the prototype field
has changed from `$$name$$` to `__name__`.

For custom names, dollar signs are no longer prepended and appended. You are
advised to prepend and append two underscores wherever you specify a value
for the field's "prototype_name" option.

Before:

```
$builder->add('tags', 'collection', array('prototype' => 'proto'));

// results in the name "$$proto$$" in the template
```

After:
You can now customize the name of the prototype field by changin the
Copy link
Member

Choose a reason for hiding this comment

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

Why do you want to remove this part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I don't remember this was even possible in 2.0 ... the documentation says the "prototype" option is supposed to be a boolean, so the 'prototype' => 'proto', part looks very dubious to me. And the $$name$$ default does not look it is configurable at all in the code in 2.0... what do you think?

"prototype_name" option. You are advised to prepend and append two
underscores wherever you specify a value for the field's "prototype_name"
option.

```
$builder->add('tags', 'collection', array('prototype' => '__proto__'));
$builder->add('tags', 'collection', array('prototype_name' => '__proto__'));

// results in the name "__proto__" in the template
```
Expand Down