namespace externalServices\Service;
class FirstService extends Exception {
}
now Exception is not defined. I know I can do use \Exception AS Exception; But how can I import all native classes to the namespace
namespace externalServices\Service;
class FirstService extends Exception {
}
now Exception is not defined. I know I can do use \Exception AS Exception; But how can I import all native classes to the namespace
收起
Can't be done.
The solution is to either manually import...
use Exception; //Notice leading \ is not needed
Or use an absolute path...
class FirstService extends \Exception {
报告相同问题?