Skip to content

Commit

Permalink
Make view renderer accessible to subclasses and pass custom button at…
Browse files Browse the repository at this point in the history
…tributes
  • Loading branch information
flack committed Aug 3, 2023
1 parent 347c14e commit f99775e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/midcom/datamanager/template/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function __construct(renderer $renderer)
midcom::get()->head->prepend_stylesheet(MIDCOM_STATIC_URL . '/midcom.datamanager/default.css');
}

private function get_view_renderer() : view
protected function get_view_renderer() : view
{
return new view($this->renderer);
}
Expand Down Expand Up @@ -230,7 +230,7 @@ public function button_widget(FormView $view, array $data)
$data['label'] = $data['name'];
}

return '<button type="' . $type . '" ' . $this->renderer->block($view, 'button_attributes') . '>' . $this->renderer->humanize($data['label']) . '</button>';
return '<button type="' . $type . '" ' . $this->renderer->block($view, 'button_attributes', $data) . '>' . $this->renderer->humanize($data['label']) . '</button>';
}

public function hidden_widget(FormView $view, array $data)
Expand Down

0 comments on commit f99775e

Please sign in to comment.