Source of file GridFieldHtmlFragment.php
Size: 1,071 Bytes - Last Modified: 2021-12-24T06:34:24+00:00
/var/www/docs.ssmods.com/process/src/src/Forms/GridFieldHtmlFragment.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 | <?php namespace BringYourOwnIdeas\Maintenance\Forms; use SilverStripe\Forms\GridField\GridField; use SilverStripe\Forms\GridField\GridField_HTMLProvider; /** * Facilitates adding arbitrary HTML to grid fields * * @package forms * @subpackage fields-gridfield */ class GridFieldHtmlFragment implements GridField_HTMLProvider { /** * Fragment to write the html fragment to. * @var string */ protected $targetFragment; /** * An HTML fragment to render * @var string */ protected $htmlFragment; /** * @param string $targetFragment Fragment to write the html fragment to. * @param string $htmlFragment An HTML fragment to render */ public function __construct($targetFragment, $htmlFragment) { $this->targetFragment = $targetFragment; $this->htmlFragment = $htmlFragment; } /** * @param GridField $gridField * @return array */ public function getHTMLFragments($gridField) { return [$this->targetFragment => $this->htmlFragment]; } } |