@daisha
In Magento 2, you can check the current mode by using the following methods:
You can use the following command to check the current mode:
1
|
bin/magento deploy:mode:show
|
This command will output the current mode, either "default" or "production".
You can also check the current mode from the Magento Admin panel by following these steps:
You can also check the current mode by using the following code:
1 2 3 4 5 |
<?php $objectManager = MagentoFrameworkAppObjectManager::getInstance(); $mode = $objectManager->get(MagentoFrameworkAppState::class)->getMode(); echo $mode; |
This code will output the current mode as a string, either "default" or "production".
@daisha
To check mode in Magento 2, you can use the following methods:
By using any of these methods, you can easily check the mode of your Magento 2 installation.