Skip to content

Commit 370b6c5

Browse files
authored
Merge pull request #804 from ShevArtV/sendit
Добавил описание события senditOnSetValue
2 parents 66d8e6f + f90e7de commit 370b6c5

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

docs/components/sendit/events.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,28 @@ switch ($modx->event->name){
148148
```php:line-numbers
149149
switch ($modx->event->name){
150150
case 'senditOnGetWebConfig':
151-
$object->webConfig['myparam'] = 'test;
151+
$object->webConfig['myparam'] = 'test';
152+
break;
153+
}
154+
```
155+
156+
:::
157+
158+
#### senditOnSetValue - генерируется перед присвоением нового значения ключу в $_POST
159+
160+
Доступные параметры:
161+
162+
* **$key** - имя поля.
163+
* **$value** - оригинальное значение.
164+
* **$SendIt** - экземпляр класса SendIt.
165+
166+
::: details Пример плагина
167+
168+
```php:line-numbers
169+
switch ($modx->event->name){
170+
case 'senditOnSetValue':
171+
// устанавливаем оригинальное значение без каких-либо проверок
172+
$SendIt->newValue = $value;
152173
break;
153174
}
154175
```

0 commit comments

Comments
 (0)