You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: en/02_Developer_Guides/00_Model/13_Managing_Records.md
+2
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ of some other record or directly [in a ModelAdmin](../customising_the_admin_inte
12
12
13
13
## Getting an edit link
14
14
15
+
The [`DataObject::CMSEditLink()`](api:SilverStripe\ORM\DataObject::CMSEditLink()) method will give you the edit link if there is one, but by default it just returns `null`.
16
+
15
17
There is a [CMSEditLinkExtension](api:SilverStripe\Admin\CMSEditLinkExtension) specifically
16
18
for the purpose of generating links to the edit forms of records. It operates on the assumption that your record is being edited in
17
19
a [GridFieldDetailForm](../forms/field_types/gridfield#gridfielddetailform) in some `GridField` (be it on another record or in a
You can also use the new [CMSEditLinkExtension](api:SilverStripe\Admin\CMSEditLinkExtension) to provide a`CMSEditLink()` method on the record - see [Managing Records](../model/managing_records#getting-an-edit-link).
170
+
You can also use the new [CMSEditLinkExtension](api:SilverStripe\Admin\CMSEditLinkExtension) to update the value of the`CMSEditLink()` method on the record - see [Managing Records](../model/managing_records#getting-an-edit-link).
- Native indexed PHP arrays can now be passed into templates and iterated over with `<% loop $MyArray %>`. Under the hood they are wrapped in [`ArrayList`](api:SilverStripe\View\ViewableData), so you can get the count using `$Count` and use `<% if $ArrayList %>` as a shortcut for `<% if $ArrayList.Count %>`. Other functionality from `ArrayList` such as filtering and sorting cannot be used on arrays since they don't have keys to filter or sort against.
187
187
- Modules no longer need to have a root level `_config.php` or `_config` directory to be recognised as a Silverstripe CMS module. They will now be recognised as a module if they have a `composer.json` file with a `type` of `silverstripe-vendormodule` or `silverstripe-theme`.
188
+
- A new [`DataObject::CMSEditLink()`](api:SilverStripe\ORM\DataObject::CMSEditLink()) method has been added, which returns `null` by default. This provides more consistency for that method which has previously been inconsistently applied to various subclasses of `DataObject`. See [managing records](/developer_guides/model/managing_records/#getting-an-edit-link) for more details about providing sane values for this method in your own subclasses.
0 commit comments