UncleCheese\BetterButtons\Actions\BetterButtonLink
Defines the a button that can contain an arbitrary link, e.g. an external one
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class BetterButtonLink
extends BetterButtonAction
{
- // members
- protected $link;
- // Inherited members from BetterButtonAction
- protected Form $form;
- protected $buttonText;
- protected $buttonName;
- protected GridFieldDetailForm_ItemRequest $gridFieldRequest;
- // methods
- public void __construct()
- public string getButtonLink()
- public void newWindow()
- // Inherited methods from BetterButtonAction
- public void __construct()
- public void bindGridField()
- public string getButtonName()
- public string getButtonLink()
- public bool shouldDisplay()
- public string getButtonHTML()
- public string getButtonText()
- public BetterButtonAction setConfirmation()
- public SSViewer FieldHolder()
Hierarchy
Members
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 - $link
—
string
The link, absolute or relative
Methods
public
- __construct() — Builds the button
- getButtonLink() — Gets the link for the button
- newWindow() — Makes the link to open to a new tab. If not used, the CMS will try to load the link via an AJAX request, which can cause problems if the link target is not a page inside the CMS.
Inherited from UncleCheese\BetterButtons\Actions\BetterButtonAction
public
- 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