/** * Return the title of the printed page * * @param GridField * * @return array */ public function getTitle(GridField $gridField) { $form = $gridField->getForm(); $currentController = Controller::curr(); $title = ''; if (method_exists($currentController, 'Title')) { $title = $currentController->Title(); } else { if ($currentController->Title) { $title = $currentController->Title; } else { if ($form->Name()) { $title = $form->Name(); } } } if ($fieldTitle = $gridField->Title()) { if ($title) { $title .= " - "; } $title .= $fieldTitle; } return $title; }