Skip to content

Commit 472da7b

Browse files
committed
Fix argument in 4.x controller docs
1 parent f10fad7 commit 472da7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/4.x/extend/controllers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ Perform request validation in your controller’s `beforeAction()` method to enf
211211
Craft requires a valid [CSRF token](../dev/controller-actions.md#csrf) for any <badge vertical="baseline" type="verb">POST</badge> requests. This can be disabled for an entire controller by overriding its `$enableCsrfValidation` property, or just for a specific action:
212212

213213
```php
214-
public function beforeAction($action): bool
214+
public function beforeAction($actionId): bool
215215
{
216216
// Don’t require a CSRF token for incoming webhooks:
217-
if ($action->id === 'receive-webhook') {
217+
if ($actionId === 'receive-webhook') {
218218
$this->enableCsrfValidation = false;
219219
}
220220

221-
return parent::beforeAction($action);
221+
return parent::beforeAction($actionId);
222222
}
223223
```
224224

0 commit comments

Comments
 (0)