UncleCheese\BetterButtons\Controllers\BetterButtonsCustomActionRequest
A subcontroller that handles custom actions. The parent controller matches the url_param '$Action!' and doesn't hand off any trailing params. This subcontoller is aware of them
/item/4/customaction/my-dataobject-method Invokes "my-dataobject-method" on the record
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class BetterButtonsCustomActionRequest
extends RequestHandler
{
- // members
- private static array $url_handlers = ;
- private static array $allowed_actions = ;
- protected GridFieldBetterButtonsItemRequest $parent;
- protected GridFieldDetailForm_ItemRequest $controller;
- protected DataObject $record;
- protected Form $form;
- // methods
- public void __construct()
- public HTTPResponse handleCustomAction()
Hierarchy
Extends
- SilverStripe\Control\RequestHandler
Members
private
- $allowed_actions — array
- $url_handlers — array
protected
- $controller
—
UncleCheese\BetterButtons\Controllers\GridFieldDetailForm_ItemRequest
The parent controller - $form
—
UncleCheese\BetterButtons\Controllers\Form
The Form that is editing the record - $parent
—
UncleCheese\BetterButtons\Controllers\GridFieldBetterButtonsItemRequest
The parent extension. There are actually some useful methods in the extension itself, so we need access to that object - $record
—
UncleCheese\BetterButtons\Controllers\DataObject
The record we're editing
Methods
public
- __construct() — Buidls the request
- handleCustomAction() — Takes the action at /customaction/my-action-name and feeds it to the DataObject.