Controller/Adminhtml/Subscription/AddRow.php
public function execute()
    {
        $rowId = (int) $this->getRequest()->getParam('id');
        $rowData = $this->_objectManager->create('CheckoutCom\Magento2\Model\Subscription');
        if ($rowId) {
            $rowData = $rowData->load($rowId);
            $rowTitle = $rowData->getTitle();
            if (!$rowData->getEntityId()) {
                $this->messageManager->addError(__('This item no longer exists.'));
                $this->_redirect('checkout_com/subscription/rowdata');
                return;
            }
        }
 
        $this->_coreRegistry->register('row_data', $rowData);
        $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        $title = $rowId ? __('Edit Item').$rowTitle : __('Add New Item');
        $resultPage->getConfig()->getTitle()->prepend($title);
        return $resultPage;
    }
public function execute()
    {
        $rowId = (int) $this->getRequest()->getParam('id');
        $rowData = $this->_objectManager->create('CheckoutCom\Magento2\Model\Subscription');
        if ($rowId) {
            $rowData = $rowData->load($rowId);
            $rowTitle = $rowData->getTitle();
            if (!$rowData->getEntityId()) {
                $this->messageManager->addError(__('This item no longer exists.'));
                $this->_redirect('checkout_com/subscription/rowdata');
                return;
            }
        }
 
        $this->_coreRegistry->register('row_data', $rowData);
        $resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        $title = $rowId ? __('Edit Item').$rowTitle : __('Add New Item');
        $resultPage->getConfig()->getTitle()->prepend($title);
        return $resultPage;
    }
public function execute ( ) { $ rowId = ( int ) $ this -> getRequest ( ) -> getParam ( 'id' ) ; $ rowData = $ this -> _objectManager -> create ( 'CheckoutCom\Magento2\Model\Subscription' ) ; if ( $ rowId ) { $ rowData = $ rowData -> load ( $ rowId ) ; $ rowTitle = $ rowData -> getTitle ( ) ; if ( ! $ rowData -> getEntityId ( ) ) { $ this -> messageManager -> addError ( __ ( 'This item no longer exists.' ) ) ; $ this -> _redirect ( 'checkout_com/subscription/rowdata' ) ; return ; } } $ this -> _coreRegistry -> register ( 'row_data' , $ rowData ) ; $ resultPage = $ this -> resultFactory -> create ( ResultFactory :: TYPE_PAGE ) ; $ title = $ rowId ? __ ( 'Edit Item' ) . $ rowTitle : __ ( 'Add New Item' ) ; $ resultPage -> getConfig ( ) -> getTitle ( ) -> prepend ( $ title ) ; return $ resultPage ; }
Add New Row Form page.

@return \Magento\Backend\Model\View\Result\Page
Add New Row Form page .