3

What is the difference and when to use vendor/magento/framework code, and when to use the vendor/magento/module-* code?

1 Answer 1

4

Under the vendor/magento/framework folder, magento 2 is keeping its core logic, the basic functionalities which are widely used in the rest of the modules under the vendor/magento/module-*/.

For example take a look in vendor/magento/framework/Url.php class and you will find methods as getUrl() or getCurrentUrl(). Or in vendor/magento/framework/Registry.php class, at registry($key), register($key, $value, $graceful = false), unregister($key) methods.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.