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

Reusable custom Form Types reference #245

Merged
merged 30 commits into from
Apr 17, 2019
Merged

Conversation

zuk3975
Copy link
Contributor

@zuk3975 zuk3975 commented Apr 10, 2019

No description provided.

@zuk3975 zuk3975 changed the title [WIP] FormTypes reference [WIP] Reusable custom Form Types reference Apr 10, 2019

* [CountryChoiceType](country-choice)

* [MeterialChoiceTableType](meterial-choice-table)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* [MeterialChoiceTableType](meterial-choice-table)
* [MaterialChoiceTableType](material-choice-table)

you have several errors like this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

{
$builder
->add('name', TextType::class)
## this would provide default choices, which are the choices from PrestaShhop database
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## this would provide default choices, which are the choices from PrestaShhop database
## this would provide default choices, which are the choices from PrestaShop database

## Form types reference

While developing on PrestaShop you can use any form field type that is provided by Symfony framework.
More about Symfony field types: https://symfony.com/doc/current/reference/forms/types.html.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
More about Symfony field types: https://symfony.com/doc/current/reference/forms/types.html.
More about Symfony form types: https://symfony.com/doc/current/reference/forms/types.html.

It's called form types in Symfony docs, so better to refer to the same name for consistency.


* [TranslatableType](translatable)

* [TranslateTextType](translate-text)
Copy link
Contributor

Choose a reason for hiding this comment

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

TranslateTextType is deprecated, should we still document it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess not, ill remove it.

### CategoryChoiceTreeType

CategoryChoiceTreeType is a child of [MaterialChoiceTreeType](material-choice-tree), it extends parent options
with options listed bellow. It is used to display category tree selection box and requires
Copy link
Contributor

Choose a reason for hiding this comment

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

It is used to display category tree selection box

IMO a screenshot of the rendered form type would make it easier for developers to understand what they can expect from each form type.


| Option | Type (default value) | Description |
| ----------------------------| ------------------------------------------|-------------------------------------------------|
| **choices_tree** | **array**(choices list provided by CategoryTreeChoiceProvider.php)| Values to choose from in choices tree |
Copy link
Contributor

Choose a reason for hiding this comment

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

(choices list provided by CategoryTreeChoiceProvider.php)

IMO something like (array with all available category choices) would sound better.

@zuk3975 zuk3975 changed the title [WIP] Reusable custom Form Types reference Reusable custom Form Types reference Apr 16, 2019
@sarjon
Copy link
Contributor

sarjon commented Apr 16, 2019

@matks review when you have time.

@matks
Copy link
Contributor

matks commented Apr 16, 2019

@matks review when you have time.

This is no more in WIP :) ?

@sarjon
Copy link
Contributor

sarjon commented Apr 16, 2019

This is no more in WIP :) ?

Yeah, but I think there a space for improvements, so give your feedback. :)

Copy link
Contributor

@matks matks left a comment

Choose a reason for hiding this comment

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

One minor mistake, one more emphasis

Congrats for the hard work on this doc 😄

matks and others added 2 commits April 17, 2019 13:19
Co-Authored-By: sarjon <jonusas.sarunas@gmail.com>
Co-Authored-By: sarjon <jonusas.sarunas@gmail.com>
@sarjon
Copy link
Contributor

sarjon commented Apr 17, 2019

@matks all comments addressed.

@matks
Copy link
Contributor

matks commented Apr 17, 2019

Thank you @zuk3975 and @sarjon for the hard work
Thank you @rokaszygmantas for the review

@matks matks merged commit bd026d8 into PrestaShop:master Apr 17, 2019
@sarjon sarjon deleted the docs/form-type branch April 17, 2019 12:45
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