Skip to content
Open
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
18 changes: 18 additions & 0 deletions docs/5.x/extend/element-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down