DOC Add example for using resource location for pages / modeladmin

This commit is contained in:
Jake B 2017-10-18 15:55:50 +11:00
parent 3e9dc5c7d2
commit 97dfd9ac47

View File

@ -300,6 +300,20 @@ $themesFilePath = ThemeResourceLoader::inst()->findThemedResource('css/styles.cs
$themeFolderPath = ThemeResourceLoader::inst()->getPath('simple');
```
Usage for Page and ModelAdmin:
```php
class ListingPage extends \Page {
private static $icon = 'mycompany/silverstripe-mymodule: client/images/sitetree_icon.png';
}
```
```php
class MyCustomModelAdmin extends \SilverStripe\Admin\ModelAdmin {
private static $menu_icon = 'mycompany/silverstripe-mymodule: client/images/modeladmin_icon.png';
}
```
To ensure consistency, we've also deprecated support for path constants:
* `FRAMEWORK_DIR` and `FRAMEWORK_PATH`