Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPDATE readme to include DataExtension example #166

Open
wants to merge 1 commit into
base: 1.3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,35 @@ In this case, your action handler receives `$data` and `$form`, just like a cont
}
```

### Implementing With DataExtension

In cases where you may need to implement custom buttons with a `DataExtension` use the extension points provided. These include the following:

- `updateBetterButtonsActions` (`getBetterButtonsActions`)
- `updateBetterButtonsUtils` (`getBetterButtonsUtils`)

The `FieldList` of actions is passed in to these methods. The following example shows how this might work:

```php
/**
* @param $actions
*/
public function updateBetterButtonsActions($actions)
{
$actions->push(BetterButtonCustomAction::create('approveRecord', 'Approve Record'));
$actions->push(BetterButtonNestedForm::create(
'updateRecord',
'Update This Record',
FieldList::create(
TextareaField::create('FooField')
->setTitle('A Field To Process'),
HiddenField::create('AHiddenField')
->setValue('A Hidden Value)
)
));
}
```


### Disabling Better Buttons

Expand Down