ivoba / silverstripe-gridfield-html
GridField 组件,用于添加任何 HTML 片段
1.0.1
2019-01-21 10:35 UTC
Requires
- php: >=7
- silverstripe/framework: ^4
This package is auto-updated.
Last update: 2024-09-21 23:04:10 UTC
README
GridField 组件,用于在 GridField 附近添加任何 HTML 片段
简单到愚蠢...
安装
通过 Composer
{ "require": { "ivoba/silverstripe-gridfield-html": "^1.0" } }
需求
- SilverStripe 4
用法
有时候你只想在操作旁边添加一个链接,有时候想在网格顶部添加一些文字,有时候想在网格下方添加一张重要的图片。
$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>' ]));
许可
MIT 许可证 (MIT)。有关更多信息,请参阅许可文件。