From 54cc49c4cb509471ca10fa37aa78558d6d34d417 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Thu, 19 Mar 2026 00:08:57 +0100 Subject: [PATCH] Update element-types.md --- docs/5.x/extend/element-types.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/5.x/extend/element-types.md b/docs/5.x/extend/element-types.md index cc09acbcc..1cd9730f3 100644 --- a/docs/5.x/extend/element-types.md +++ b/docs/5.x/extend/element-types.md @@ -952,6 +952,24 @@ protected function route(): array|string|null ]; } ``` +You can also use your custom controller actions inside the routes of your element type: + +```php +protected function route(): array|string|null +{ + return ['plugin/product/see', ['element' => $this]]; + +} +``` +And you will get any params you provide on your ``ProductController`` action: + +```php +public function actionSee(Product $element): Response +{ + // Additional operations + return $this->renderTemplate(...); +} +``` ## Editing Elements