Version 6 pre-stable
This version of Silverstripe CMS has not yet been given a stable release. See the release roadmap for more information. Go to documentation for the most recent stable version.

Extending existing ModelAdmin

Sometimes you'll work with ModelAdmins from other modules. To customise these interfaces, you can always subclass. But there's also another tool at your disposal: The Extension API.

namespace App\Extension;

use SilverStripe\Core\Extension;

class MyAdminExtension extends Extension
{
    protected function updateEditForm($form)
    {
        $form->Fields()->push(/* ... */)
    }
}

Now enable this extension through your config.yml file (see the configuration documentation).

MyAdmin:
  extensions:
    - App\Extension\MyAdminExtension

The following extension points are available: updateEditForm(), updateSearchContext(), updateSearchForm(), updateList(), updateImportForm.