silverstripe-framework/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/How_Tos/Extending_An_Existing_ModelAdmin.md
Aaron Carlino 6888901468
NEW: Update docs to be compliant with Gatsby site (#9314)
* First cut

* Temporarily disable composer.json for netlify build

* POC

* New recursive directory query, various refinements

* Fix flexbox

* new styled components plugin

* Apply frontmatter delimiters

* Mobile styles, animation

* Search

* Redesign, clean up

* Nuke the cache, try again

* fix file casing

* Remove production env file

* ID headers

* Move app to new repo

* Add frontmatter universally

* Hide children changelogs

* Add how to title

* New callout tags

* Revert inline code block change

* Replace note callouts

* Fix icons

* Repalce images

* Fix icon

* Fix image links

* Use proper SQL icon
2019-11-18 17:58:33 +13:00

35 lines
873 B
Markdown

---
title: Extending an existing ModelAdmin
summary: ModelAdmin interfaces that come with the core can be customised easily
---
## 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:SilverStripe\Core\Extension) API.
```php
use SilverStripe\Core\Extension;
class MyAdminExtension extends Extension
{
// ...
public function updateEditForm(&$form)
{
$form->Fields()->push(/* ... */)
}
}
```
Now enable this extension through your `[config.yml](/topics/configuration)` file.
```yml
MyAdmin:
extensions:
- MyAdminExtension
```
The following extension points are available: `updateEditForm()`, `updateSearchContext()`,
`updateSearchForm()`, `updateList()`, `updateImportForm`.