How to get base directory programmatically in Magento 2 April 21, 2016 - Fire development, Magento 2 It is possible to get base directory programmatically in Magento 2 the same way as you do it in 1.x, since it is available in the constant BP: define('BP', dirname(__DIR__)); 1 define('BP', dirname(__DIR__)); Source More tips from the cookbook Related postsHow to generate order increment IDs automatically during Magento 2 importHow to update products that are not listed in a product table during Magento 2 importHow to Import Customers & Customer Addresses to Magento 2Magento 2 Release NotesAdobe (Magento 2) Commerce and Cloud (Enterprise Edition) Specific FeaturesMagento 2 B2B Company Guide: Revealing Company Structure & ImportShopware 6 Advanced Pricing Guide + Import TutorialAmasty ChatGPT AI Content Generator for Magento 2 Post Tags:base directorymagento 2Magento 2 Developer’s Cookbook Homepage » Fire development » How to get base directory programmatically in Magento 2 Please enable JavaScript to view the comments powered by Disqus. ← Previous Post Next Post →