Skip to content

Commit eaf45f8

Browse files
committed
Document custom panel post params
1 parent 7c5dede commit eaf45f8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/panels/custom.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,20 @@ $panel.trigger('reload');
9797
$panel.trigger('reload', { animate: true });
9898
```
9999

100+
### Post params
101+
102+
To pass data from JS to the PHP panels class, pass a `params` option that will be sent as POST data.
103+
104+
```js
105+
/* Send data from JS */
106+
$panel.trigger('reload', { params: { page: 4 } });
107+
```
108+
109+
```php
110+
/* Access data from PHP */
111+
$page = $_POST['page'] ?? 1;
112+
```
113+
100114
## Markup helpers
101115

102116
The panel class has a few helpers to render common markup categories.

0 commit comments

Comments
 (0)