Skip to content

Instantly share code, notes, and snippets.

@rotassator
Last active February 11, 2016 00:27
Show Gist options
  • Save rotassator/46ccdf30bb5b5a7883ac to your computer and use it in GitHub Desktop.
Save rotassator/46ccdf30bb5b5a7883ac to your computer and use it in GitHub Desktop.
SilverStripe: make fields read-only on admin content tab
<?php
// make main tab fields read-only
$main_fields = $fields->fieldByName('Root.Main')->Fields();
foreach ($main_fields as $field) {
$main_fields->push($field->performReadonlyTransformation());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment