PHP code example of restruct / silverstripe-admintweaks
1. Go to this page and download the library: Download restruct/silverstripe-admintweaks 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/ */
restruct / silverstripe-admintweaks example snippets
class ProductAdmin extends ModelAdmin
{
// Open the GridField search bar on load instead of hiding it behind the magnifier icon
private static bool $auto_expand_gridfield_search = true;
// Hide the framework-scaffolded Export to CSV / Print / Import CSV buttons
// (the scaffolded export just dumps summary_fields; the default CsvBulkLoader
// import is a data-integrity risk on synced/managed models)
private static bool $hide_scaffolded_csv_buttons = true;
}
// Add Bootstrap icon to a button
FormAction::create('add', 'Add Item')->addExtraClass('bi bi-plus-circle');