I want to have a downloadable link in my admin form. I want to fetch file name from my table and file is located under Magento_Root/pub/media/
directory.
Note: this form is being used for just edit few fields (mainly informative)
Magento – Magento 2 : Add link in Admin UI form
adminformmagento-2.1uicomponent
Best Answer
in ui_form.xml
note following things:
(custom_link) field ID
(elementTmpl) template path
(my_url) dynamic value will set in Data Provider
in app/code/Vendor/Module/view/adminhtml/web/template/input.html
In DataProvider.php
You can see the output in the screenshot