How to import vendor files in CakePHP 3x

前端 未结 5 1825
庸人自扰
庸人自扰 2020-12-31 05:37

I\'m working with CakePHP 3(beta 2) version recently launched. I need to integrate Facebook Login using PHP SDKs and I\'m not clear with importing vendor files in thi

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-31 06:00

    Well you will have to load it yourself if composer is not an option. You can always use the very basic require method and create a new instance of the vendor class yourself. Reference: http://book.cakephp.org/3.0/en/core-libraries/app.html#loading-vendor-files

    Use:

     //The following line should do the same like App::import() in the older version of cakePHP
     require_once(ROOT . 'vendor' . DS  . 'Facebook' . DS . 'src' . DS . 'facebook.php');
    
     $facebookApi = new facebook();
    

提交回复
热议问题