Skip to content

Commit

Permalink
Use of option var instead of fixed key
Browse files Browse the repository at this point in the history
  • Loading branch information
easis authored Nov 22, 2024
1 parent 57866e7 commit afbd54a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docs/src/docs/components/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,11 @@ class ModalActionType extends ButtonActionType
{
public function buildView(ActionView $view, ActionInterface $action, array $options): void
{
$templatePath = $options['template_path'];

if ($view->parent instanceof ColumnValueView) { // [!code ++]
$value = $view->parent->vars['value']; // [!code ++]

foreach (['template_path', 'template_vars'] as $optionName) { // [!code ++]
if (is_callable($templatePath)) { // [!code ++]
if (is_callable($options[$optionName])) { // [!code ++]
$options[$optionName] = $options[$optionName]($value); // [!code ++]
} // [!code ++]
} // [!code ++]
Expand Down

0 comments on commit afbd54a

Please sign in to comment.