Source of file BetterButtonNestedForm.php
Size: 1,240 Bytes - Last Modified: 2021-12-23T10:56:01+00:00
/var/www/docs.ssmods.com/process/src/src/Actions/BetterButtonNestedForm.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | <?php namespace UncleCheese\BetterButtons\Actions; use SilverStripe\Forms\FieldList; use UncleCheese\BetterButtons\Actions\BetterButtonAction; /** * Defines a button that launches a nested form * * @author Uncle Cheese <unclecheese@leftandmain.com> * @package silverstripe-gridfield-better-buttons */ class BetterButtonNestedForm extends BetterButtonCustomAction { /** * @var FieldList */ protected $fields; /** * Builds the button * @param string $actionName The name of the action (method) * @param string $text The text for the button * @param FieldList $fields */ public function __construct($actionName, $text, FieldList $fields) { $this->fields = $fields; $this->addExtraClass('better-button-nested-form'); parent::__construct($actionName, $text); } /** * Gets the link for the button * @return string */ public function getButtonLink() { $link = 'nestedform?action='.$this->actionName; return $this->gridFieldRequest->Link($link); } /** * Gets the field list * @return FieldList */ public function getFields() { return $this->fields; } } |