As I checked from magento 2 documentation about changing minicart content.
There are two ways :
We change it by customizing minicart.phml and placing it in:
app/design/frontend/OrangeCo/orange/Magento_Checkout/templates/cart/minicart.phtml
- But on the other page :
http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/templates/template-sample.html
We customise it in content.html and place it in:
app/design/frontend/OrangeCo/orange/Magento_Checkout/web/template/minicart/content.html
So these questions are :
How magento 2 decides when to use html file and phtml file ?
Is this related to 3 mode in Magento 2: Default, Developer and Production ?
Best Answer
Both
.phtml
and.html
files are part of the view layer in Magento 2 difference beingphtml
files work with Block which according to Magento Docs is a special PHP class that is usually (but not always) connected to a template closely. Blocks usually work with model layer (core Magento) to manipulate data and return results/response to templates (.phtml or .html files). These files are used by layout files in setting up templates for certain blocks and so on.html
files on the other end are solely used to display content on the frontend and javascript libraries such as knockout JS use them accordingly. These files are also used for AJAX content loading.