silverstripe-gridfieldexten.../code/GridFieldAddNewMultiClassHandler.php
ajshort d7a9d470f9 Add GridFieldAddNewMultiClass component.
This component allows the user to select from a list of classes when creating a new record.
2013-02-02 14:14:59 +11:00

18 lines
431 B
PHP

<?php
/**
* A custom grid field request handler that allows interacting with form fields when adding records.
*/
class GridFieldAddNewMultiClassHandler extends GridFieldDetailForm_ItemRequest {
public function Link($action = null) {
if($this->record->ID) {
return parent::Link($action);
} else {
return Controller::join_links(
$this->gridField->Link(), 'add-multi-class', get_class($this->record)
);
}
}
}