custom action in v4 changes?

in v3 i would extend an action like this
class MyCustomAction extends Action
{
protected function setUp(): void
{
parent::setUp();
$someRecord = $this->getRecord();
}
}
class MyCustomAction extends Action
{
protected function setUp(): void
{
parent::setUp();
$someRecord = $this->getRecord();
}
}
Then use that custom action In a Page
protected function getHeaderActions(): array
{
return [
MyCustomAction::make('my-action')->record($this->getRecord()),
];
}
protected function getHeaderActions(): array
{
return [
MyCustomAction::make('my-action')->record($this->getRecord()),
];
}
Now in V4, $this->getRecord() is NULL because setUp() runs before the built in ->record() method. So what is the best practise on extending Action in classes for v4? I could. not find anything in the new docs.
1 Reply
Dan Harrin
Dan Harrin2mo ago
how are you using the record once you have it?

Did you find this page helpful?