<?php
namespace MyProject;
use SilverStripe\Core\Extension;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextareaField;
use SilverStripe\Forms\TextField;
class MyFormFactoryExtension extends Extension
{
public function updateFormFields(FieldList $fields)
{
$fields->insertAfter(
'Title',
TextareaField::create('Description', 'Description')
);
$fields->insertAfter(
'Title',
TextField::create('Copyright', 'Copyright')
);
}
}
<?php
use SilverStripe\Core\Extension;
use SilverStripe\Forms\TextField;
class MyFileSearchFormExtension extends Extension
{
public function updateFormFields(&$fields, $controller, $name, $context)
{
$fields->push(TextField::create('Copyright', 'Copyright'));
}
}
The problem is making use of that in real searches: there seems to be a mix of client JavaScript and server GrapQL that has changed quite a bit since the 4.0 release. Unfortunately I’m not fond of that part of SilverStripe so I cannot give you any advice.