In Magento 2.2.5, How to change the URL of save button in the admin grid.
Note: I am not creating grid through ui_component, I am creating grid using layout.
 asked Oct 9, 2018 at 6:07
 
 
 
 Saravanan DS 
 
 1,1461 gold badge18 silver badges46 bronze badges
 
 - 
 What you want to change <item name="save" xsi:type="string">Vendor\Module\Block\Adminhtml\Edit\SaveButton</item>?Rutvee Sojitra– Rutvee Sojitra2018年10月09日 06:20:32 +00:00Commented Oct 9, 2018 at 6:20
- 
 @RutveeSojitra It is not Ui component GridSaravanan DS– Saravanan DS2018年10月09日 06:21:22 +00:00Commented Oct 9, 2018 at 6:21
- 
 Okay so in layout what you want change? means which url url are you talking about?Rutvee Sojitra– Rutvee Sojitra2018年10月09日 06:22:35 +00:00Commented Oct 9, 2018 at 6:22
1 Answer 1
You can modify the save button URL by overriding the getSaveUrl() function.
Navigate to
app/code/Vendor/Module/Block/Adminhtml/Module/Edit.php
add the following function in this file
public function getSaveUrl()
{
 return $this->getUrl('module/controller/action');
}
 answered Oct 9, 2018 at 6:28
 
 
 
 Dinesh Yadav 
 
 6,5252 gold badges24 silver badges51 bronze badges
 
 - 
 Its working fine.Saravanan DS– Saravanan DS2018年10月09日 06:44:21 +00:00Commented Oct 9, 2018 at 6:44
default