Closed oniwo closed 8 years ago
Did you write a use statement? CJAX class is inside namespace CJAX\Core, so you have to import it by:
use CJAX\Core\CJAX;
Alternatively you can use the fully qualified name for CJAX class:
$ajax = \CJAX\Core\CJAX::getInstance();
Hope this helps.
I had not written the use statement. I had no idea it was necessary. Just starting to get the hang of this namespace concept in PHP. Thank you so much, each of the two approaches work very well.
I dont know why the Compiler is looking for 'cjax.php' in 'cjax/' instead of where it is in 'cjax/core/'. Please help. I am testing Version 6.0 beta 3. The error message is below.
A PHP Error was encountered
Severity: Compile Error
Message: require(): Failed opening required '/home/baba/lampstack-5.6.22-0/apache2/htdocs/examsystem/cjax/cjax.php' (include_path='.:/home/baba/lampstack-5.6.22-0/php/lib/php')
Filename: cjax/autoloader.php
Line Number: 40
Backtrace: