ivoba / silverstripe-gridfield-html
GridField component to add any HTML fragment
Installs: 121
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 1
Type:silverstripe-vendormodule
Requires
- php: >=7
- silverstripe/framework: ^4
This package is auto-updated.
Last update: 2024-10-21 23:09:25 UTC
README
GridField component to add any HTML fragment around the GridField
Stupid simple ...
Install
Via Composer
{ "require": { "ivoba/silverstripe-gridfield-html": "^1.0" } }
Requirements
- SilverStripe 4
Usage
Sometimes you just want to add a Link next to the actions, sometimes some text on top of the grid and sometimes an important image under the grid.
$gridField->getConfig()->addComponent(new GridFieldHtmlComponent([ 'buttons-before-left' => '<a href="/api/model/v1.json" target="_blank" class="font-icon-rocket btn btn-secondary">API</a>', 'before' => '<div class="alert-info">Here comes the grid</div>', 'after' => '<div class="alert-info center"><img src="https://www.seashepherd.org.au/images/news/2016/news-160204-2-3-Clean-Up-Banner-650w-2.jpg"/></div>' ]));
License
The MIT License (MIT). Please see License File for more information.