silverstripe-framework/src/Forms/GridField/GridFieldConfig_RecordViewer.php
GuySartorelli 5c54276b6f
ENH Make all GridField components injectable (using abstract class) (#10204)
* ENH Make all GridField components injectable.

Some components were already injectable, but all GridField components shipped in silverstripe should be injectable.
This makes it a LOT easier to make global project-specific changes to a given component.
The new AbstractGridFieldComponent also makes it easy to make similar wide-spread changes in the future.

* DOCS Encourage injection for GridField and GridFieldComponents.
2022-02-02 11:14:33 +13:00

22 lines
523 B
PHP

<?php
namespace SilverStripe\Forms\GridField;
/**
* Allows viewing readonly details of individual records.
*/
class GridFieldConfig_RecordViewer extends GridFieldConfig_Base
{
public function __construct($itemsPerPage = null)
{
parent::__construct($itemsPerPage);
$this->addComponent(GridFieldViewButton::create());
$this->addComponent(GridFieldDetailForm::create());
$this->removeComponentsByType(GridFieldFilterHeader::class);
$this->extend('updateConfig');
}
}