Loading Vendor Files in CakePHP 2.0

前端 未结 3 1451
花落未央
花落未央 2020-12-23 20:19

I\'m currently upgrading one of our projects to CakePHP 2.0. Unfortunately the \"first line\" of code makes problems, and I can\'t find a solution to that problem.

I

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-23 21:10

    Assume you'r vendor file located /app/vendors/facebook/facebook.php here.

    The following line should do the same like App:: import() in the older version of CakePHP

     require_once(ROOT . DS . 'app' . DS .'Vendor' . DS  . 'facebook' . DS . 'src' . DS . 'facebook.php');
    
     $facebookApi = new facebook();
    

提交回复
热议问题