CakePHP 3.0 vendor class not found

前端 未结 1 894
孤街浪徒
孤街浪徒 2020-12-20 03:59

I\'m adding an external class to a cake 3.0 app by putting it to /vendor/name folder and requiring it from a component like this:

require_once( $_SERVER[\'D         


        
相关标签:
1条回答
  • 2020-12-20 04:52

    CakePHP 3.0 uses namespaces. So use proper namespace for your vendor class or if it's not using namespaces prefix the class name with backslash when using it.

    E.g. $object = new \Test_Class();.

    0 讨论(0)
提交回复
热议问题