UncleCheese\BetterButtons\Actions\BetterButtonAction
Defines the base class for all buttons that link to arbitrary endpoints from a {@link GridFieldDetailForm}
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class BetterButtonAction
extends LiteralField
implements
BetterButtonInterface
{
- // members
- private static array $extensions = ;
- protected Form $form;
- protected $buttonText;
- protected $buttonName;
- protected GridFieldDetailForm_ItemRequest $gridFieldRequest;
- // methods
- public void __construct()
- public void bindGridField()
- public string getButtonName()
- public string getButtonLink()
- public bool shouldDisplay()
- public string getButtonHTML()
- private string getButtonClasses()
- public string getButtonText()
- public BetterButtonAction setConfirmation()
- public SSViewer FieldHolder()
Hierarchy
Extends
- SilverStripe\Forms\LiteralField
Implements
Members
private
- $extensions
protected
- $form
—
SilverStripe\Forms\Form
The form that this action is associated with - $gridFieldRequest
—
SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest
The request that is associated with the gridfield
Methods
private
- getButtonClasses() — Combines classes from $this->extraClass() with a couple of additional classes if they are applicable for this button.
public
- __construct() — Builds the action
- FieldHolder() — Generates the button. Updates the literal field with the correct HTML based on any post-contruct updates
- bindGridField() — Bind the button to the GridField request
- getButtonHTML() — Gets the HTML representing the button
- getButtonLink() — A noop that gets the link for the button
- getButtonName() — Get the name of the button. Arbitrary.
- getButtonText() — Gets the text for the button
- setConfirmation() — Sets the confirm text
- shouldDisplay() — Determines if the button should display