CakePHP 3.0 vendor class not found -


i'm adding external class cake 3.0 app putting /vendor/name folder , requiring component this:

require_once( $_server['document_root'].'/project/vendor/external/testclass.php'); 

but when try getinstance(); of class - error

class 'app\controller\component\test_class' not found  

i calling component (thus \controller\component).

what i'm doing wrong?

cakephp 3.0 uses namespaces. use proper namespace vendor class or if it's not using namespaces prefix class name backslash when using it.

e.g. $object = new \test_class();.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -