src/Forms/GridField/GridFieldPrintButton.php
public function getTitle(GridField $gridField)
    {
        $form = $gridField->getForm();
        $currentController = $gridField->getForm()->getController();
        $title = '';

        if (method_exists($currentController, 'Title')) {
            $title = $currentController->Title();
        } else {
            if ($currentController->Title) {
                $title = $currentController->Title;
            } elseif ($form->getName()) {
                $title = $form->getName();
            }
        }

        if ($fieldTitle = $gridField->Title()) {
            if ($title) {
                $title .= " - ";
            }

            $title .= $fieldTitle;
        }

        return $title;
    }
public function getTitle(GridField $gridField)
    {
        $form = $gridField->getForm();
        $currentController = $gridField->getForm()->getController();
        $title = '';

        if (method_exists($currentController, 'Title')) {
            $title = $currentController->Title();
        } else {
            if ($currentController->Title) {
                $title = $currentController->Title;
            } elseif ($form->getName()) {
                $title = $form->getName();
            }
        }

        if ($fieldTitle = $gridField->Title()) {
            if ($title) {
                $title .= " - ";
            }

            $title .= $fieldTitle;
        }

        return $title;
    }
public function getTitle ( GridField $ gridField ) { $ form = $ gridField -> getForm ( ) ; $ currentController = $ gridField -> getForm ( ) -> getController ( ) ; $ title = '' ; if ( method_exists ( $ currentController , 'Title' ) ) { $ title = $ currentController -> Title ( ) ; } else { if ( $ currentController -> Title ) { $ title = $ currentController -> Title ; } elseif ( $ form -> getName ( ) ) { $ title = $ form -> getName ( ) ; } } if ( $ fieldTitle = $ gridField -> Title ( ) ) { if ( $ title ) { $ title .= " - " ; } $ title .= $ fieldTitle ; } return $ title ; }
Return the title of the printed page

@param GridField

@return array
Return the title of the printed page