Skip to content

Commit

Permalink
add handler method signatures *without* parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed May 17, 2024
1 parent 192f01f commit f34b5eb
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions modules/backend/behaviors/RelationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,13 @@ public function initRelation($model, $field = null)
*
* Example usage:
*
* $controller->bindEvent('relation.extendViewWidget', function ($widget, $field, $model) {
* $controller->bindEvent('relation.extendViewWidget', function (\Backend\Widgets\Lists|\Backend\Widgets\Form $widget, string $field, \Winter\Storm\Database\Model $model) {
* if ($field === 'myRelationField') {
* $widget->addColumns([
* 'myNewColumn' => ['label' => 'My New Column'],
* ]);
* $widget->model->bindEvent('list.extendColumns', function ($widget) {
* $widget->addColumns([
* 'myNewColumn' => ['label' => 'My New Column'],
* ]);
* });
* }
* });
*/
Expand All @@ -422,7 +424,7 @@ public function initRelation($model, $field = null)
*
* Example usage:
*
* $controller->bindEvent('relation.extendManageWidget', function ($widget, $field, $model) {
* $controller->bindEvent('relation.extendManageWidget', function (\Backend\Widgets\Lists|\Backend\Widgets\Form $widget, string $field, \Winter\Storm\Database\Model $model) {
* if ($field === 'myRelationField') {
* $widget->model->bindEvent('model.form.filterFields', function ($widget, $fields, $context) {
* if (isset($fields->myFormField)) {
Expand All @@ -446,10 +448,12 @@ public function initRelation($model, $field = null)
*
* Example usage:
*
* $controller->bindEvent('relation.extendPivotWidget', function ($widget, $field, $model) {
* $controller->bindEvent('relation.extendPivotWidget', function (\Backend\Widgets\Form $widget, string $field, \Winter\Storm\Database\Model $model) {
* if ($field === 'myRelationField') {
* $widget->addFields([
* 'myNewPivotField' => ['label' => 'My New Pivot Field'],
* $widget->model->bindEvent('form.extendFields', function ($widget) {
* $widget->addFields([
* 'myNewPivotField' => ['label' => 'My New Pivot Field'],
* ]);
* });
* }
* });
Expand Down

0 comments on commit f34b5eb

Please sign in to comment.