Update admin example code

Added an additional config block to the example code to set the AdminRootController.url_base config option as well and updated the description.
This commit is contained in:
DorsetDigital 2018-10-16 11:45:02 +01:00 committed by GitHub
parent 720c31915f
commit 97091db863
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,7 @@ Then browse to `http://localhost:6006/`
## The Admin URL
The CMS interface can be accessed by default through the `admin/` URL. You can change this by setting your own Director routing rule to the [AdminRootController](api:SilverStripe\Admin\AdminRootController) and clear the old rule like in the example below.
The CMS interface can be accessed by default through the `admin/` URL. You can change this by setting the `$url_base` config for the [AdminRootController](api:SilverStripe\Admin\AdminRootController), creating your own [Director](api:SilverStripe\Control\Director) routing rule and clearing the old rule as per the example below:
```yml
@ -81,6 +81,9 @@ SilverStripe\Control\Director:
rules:
'admin': ''
'newAdmin': 'SilverStripe\Admin\AdminRootController'
SilverStripe\Admin\AdminRootController:
url_base: 'newAdmin'
---
```