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

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -