-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1681 from nenes25/actionListModules
Add documentation for hook actionListModules
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
menuTitle: actionListModules | ||
Title: actionListModules | ||
hidden: true | ||
hookTitle: Allows you to add your own modules from a remote source in the modules list in the back office. | ||
files: | ||
- src/Core/Module/ModuleRepository.php | ||
locations: | ||
- back office | ||
type: action | ||
hookAliases: | ||
hasExample: true | ||
--- | ||
|
||
# Hook actionListModules {{< minver v="8.0" >}} | ||
|
||
## Information | ||
|
||
Hook locations: | ||
- back office | ||
|
||
Hook type: action | ||
|
||
Located in: | ||
- [src/Core/Module/ModuleRepository.php](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/Core/Module/ModuleRepository.php) | ||
|
||
## Call of the Hook in the origin file | ||
|
||
```php | ||
$modulesFromHook = $this->hookManager->exec('actionListModules', [], null, true); | ||
$modulesFromHook = array_values($modulesFromHook ?? []); | ||
``` | ||
|
||
## Example implementation | ||
|
||
This hook has been implemented in the native [ps_distributionapiclient](https://github.com/PrestaShop/ps_distributionapiclient/tree/master) module |