Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
Title: action<Controller>InitAfter
hidden: true
hookTitle:
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/controller/FrontController.php'
file: classes/controller/FrontController.php
locations:
- 'front office'
type: action
hookAliases:
array_return: false
check_exceptions: false
chain: false
origin: core
description: 'This hook is called at the end of the initialization of Smarty variables, class properties of a Front Controller.'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
Hook::exec('action' . $this->getControllerName() . 'InitAfter', ['controller' => $this]);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
Title: action<Controller>InitBefore
hidden: true
hookTitle:
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/controller/FrontController.php'
file: classes/controller/FrontController.php
locations:
- 'front office'
type: action
hookAliases:
array_return: false
check_exceptions: false
chain: false
origin: core
description: 'This hook is called at the beginning of the initialization of a front controller, before it sets any Smarty variables, class properties, redirect depending on context, etc.'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
Hook::exec('action' . $this->getControllerName() . 'InitBefore', ['controller' => $this]);
```
27 changes: 27 additions & 0 deletions modules/concepts/hooks/list-of-hooks/action<Controller>SetMedia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
Title: action<Controller>SetMedia
hidden: true
hookTitle:
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/controller/FrontController.php'
file: classes/controller/FrontController.php
locations:
- 'front office'
type: action
hookAliases:
array_return: false
check_exceptions: false
chain: false
origin: core
description: 'This hook is called after a Front Controller has registered its Stylesheets and Javascripts. You can register more files in this hook.'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
Hook::exec('action' . $this->getControllerName() . 'SetMedia');
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
Title: action<Controller>SetVariables
hidden: true
hookTitle:
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/controller/FrontController.php'
file: classes/controller/FrontController.php
locations:
- 'front office'
type: action
hookAliases:
array_return: false
check_exceptions: false
chain: false
origin: core
description: 'This hook is called after a Front Controller has set commonly used variables, available for use in the template. You can add/edit/remove variables from the array passed by reference. After the hook execution, this array of variables is assigned to Smarty.'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
$modulesVariables = array_merge(
$modulesVariables,
Hook::exec('action' . $this->getControllerName() . 'SetVariables',
[
'templateVars' => &$templateVars,
],
null,
true
)
);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
Title: action<Controller>SetVariablesBefore
hidden: true
hookTitle:
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/controller/FrontController.php'
file: classes/controller/FrontController.php
locations:
- 'front office'
type: action
hookAliases:
array_return: false
check_exceptions: false
chain: false
origin: core
description: 'This hook is called before a Front Controller starts to set commonly used variables, that are going to be assigned to Smarty. You can add/edit/remove variables from the array passed by reference..'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
Hook::exec('action' . $this->getControllerName() . 'SetVariablesBefore',
[
'templateVars' => &$templateVars,
'cart' => $cart,
]
);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
Title: actionBuild<Controller>FrontEndObject
hidden: true
hookTitle:
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/controller/FrontController.php'
file: classes/controller/FrontController.php
locations:
- 'front office'
type: action
hookAliases:
array_return: false
check_exceptions: false
chain: false
origin: core
description: 'This hook is called after the "prestashop" javascript object has been built to be sent to the front end. You can add/edit/remove variables from the array passed by reference. Those variables will be inserted in the "prestashop" javascript object.'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
Hook::exec('actionBuild' . $this->getControllerName() . 'FrontEndObject', [
'obj' => &$object,
]);
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
Title: actionOutput<Controller>HTMLBefore
hidden: true
hookTitle:
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/controller/FrontController.php'
file: classes/controller/FrontController.php
locations:
- 'front office'
type: action
hookAliases:
array_return: false
check_exceptions: false
chain: false
origin: core
description: 'This hook is called just before Smarty output the HTML Content of the page. You can edit the HTML passed by reference.'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
Hook::exec('actionOutput' . $this->getControllerName() . 'HTMLBefore', ['html' => &$html]);
```
30 changes: 30 additions & 0 deletions modules/concepts/hooks/list-of-hooks/display<Controller>Header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
Title: display<Controller>Header
hidden: true
hookTitle:
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/controller/FrontController.php'
file: classes/controller/FrontController.php
locations:
- 'front office'
type: display
hookAliases:
array_return: false
check_exceptions: false
chain: false
origin: core
description: 'This hook is called in the construction of the HOOK_HEADER Smarty variable. It is used for common front page header content.'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
$this->context->smarty->assign([
'HOOK_HEADER' => Hook::exec('displayHeader')
. Hook::exec('display' . $this->getControllerName() . 'Header'),
]);
```