Skip to content

Commit

Permalink
Add example module linl
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas nares committed Oct 30, 2023
1 parent abec2ef commit 77583ab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions development/components/form/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,12 @@ public function install()
public function hookActionProductFormDataProviderDefaultData(array $params): void
{
// define a default value for field
// define default values for fields in $params["data"]
}
```

This hook has been implemented as an example in our [modules examples repository - demoformdataproviders](https://github.com/PrestaShop/example-modules/tree/master/demoformdataproviders).

### FormDataProviderData Hook

The [`Action<FormName>FormDataProviderData` hook]({{<relref "/8/modules/concepts/hooks/list-of-hooks/action<FormName>FormDataProviderData">}}) allows your module to provide or modify the values sent to forms.
Expand All @@ -220,10 +222,12 @@ public function install()
public function hookActionProductFormDataProviderData(array $params): void
{
// change value of a submited field, accessible in
// change value of fields in $params["data"]
}
```

This hook has been implemented as an example in our [modules examples repository - demoformdataproviders](https://github.com/PrestaShop/example-modules/tree/master/demoformdataproviders).

### FormHandler hook

The `FormHandler` hooks allows to receive the `Form` data, and make operations with this data to persist it.
Expand Down

0 comments on commit 77583ab

Please sign in to comment.