Skip to content

Commit

Permalink
add resource id action in meta (#12)
Browse files Browse the repository at this point in the history
* add resource id action in meta

* remove condition
  • Loading branch information
mgoncalves76 committed Sep 7, 2020
1 parent 4f9a931 commit fa3f5c8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ActionButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ class ActionButton extends Field
*/
public function action($action, $resourceId): ActionButton
{

$actionInst = \is_string($action) ? new $action() : $action;

$actionInst->withMeta([
'resourceId' => $resourceId
]);

return $this->withMeta([
'action' => \is_string($action) ? new $action() : $action,
'action' => $actionInst,
'resourceId' => $resourceId,
]);
}
Expand Down

0 comments on commit fa3f5c8

Please sign in to comment.