I want to create custom modal popup widget and call on my .phtml
file. How can I do that?
What will be the whole procedure for creating modal and accessing it from the .phtml
file?
magento-2.1modal-popup
I want to create custom modal popup widget and call on my .phtml
file. How can I do that?
What will be the whole procedure for creating modal and accessing it from the .phtml
file?
Best Answer
You should create a module first, then after create a
requirejs-config.js
file atapp/code/Vendor/YourModule/view/frontend/requirejs-config.js
You need to create
myfile.js
inapp/code/Vendor/YourModule/view/frontend/web/js/myfile.js
Then your phtml file should look like: