PHP code example of webbuilders-group / silverstripe-gridfielditemtype

1. Go to this page and download the library: Download webbuilders-group/silverstripe-gridfielditemtype library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

webbuilders-group / silverstripe-gridfielditemtype example snippets


use WebbuildersGroup\GridField\ItemType\AddNewItemTypeButton;
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;

$config = GridFieldConfig_RecordEditor::create(10);
->removeComponentsByType('GridFieldAddNewButton::class)
    ->removeComponentsByType(GridFieldDetailForm::class)
    ->addComponent(new AddNewItemTypeButton($yourOptionsMap, 'buttons-before-left', 'empty string', 'default'))
    ->addComponent(new ItemTypeDetailForm());

use WebbuildersGroup\GridField\ItemType\AddNewItemTypeButton;
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;

$config=GridFieldConfig_Base::create(10);
$config->addComponent(new AddNewItemTypeButton($yourOptionsMap, 'buttons-before-left'));
$config->addComponent(new ItemTypeDetailForm());

use WebbuildersGroup\GridField\ItemType\VersionedItemTypeDetailForm_ItemRequest;

$detailForm->setItemRequestClass(VersionedItemTypeDetailForm_ItemRequest::class);