Magento 2 use autoload implement Code style PSR-4
You can add any custom source lib much easier by add require autoload
1. Upload lib files to vendor dir
2. Add file autoload.php in /vendor/lib-folder/autoload.php with content
like this
---- Injection from constructor and call instance in class
\Facebook\Facebook
You can add any custom source lib much easier by add require autoload
1. Upload lib files to vendor dir
2. Add file autoload.php in /vendor/lib-folder/autoload.php with content
define('FACEBOOK_SDK_V4_SRC_DIR', '/src/Facebook/'); require __DIR__ . '/src/Facebook/autoload.php';3. Save and now you can call lib from anywhere
like this
---- Injection from constructor and call instance in class
\Facebook\Facebook
Nhận xét
Đăng nhận xét