If your class library does not take a namespace, you need to use the Import method to load the class library file before instantiating it, for example: we have defined a Counter class (located at com/sina/util/counter.class.php):
- Class Counter {
- }
When used, it needs to be called as follows:
- Import (' Com.Sina.Util.Couter ');
- $object = new \counter ();
Above is an example given by thinkphp.
I was directly involved in the actual time it was supposed to be.
Require (app_path. ' admin/controller/disqus-api/wp-api.php ');//Import Disqusapi class, this class copied from WordPress wp_api.php
Require (app_path. ' admin/controller/disqus-api/category.php ');
The above is used in the WordPress Disqus API folder within the two API class files
Before 3.2 I was directly new to the class name contained in the OK,
After 3.2, we'll
$DSQ _class=new \disquswordpressapi ($message [' short_name '], $api _key, $dsq _user_api_key);
So to instantiate
Make a note of the above content