Using classes without namespace with Yii2
问题 I want to use Checkout SDK with Yii2 but since this library does not support PSR-4 standards (namespaces) I am having trouble to integrate it. How can I use this library for my purpose? EDIT As suggested I tried to use class as $sale = new \Twocheckout_Sale(); but still I am unable to make it work. 回答1: When the class does not have namespace it means it's in the root namespace. Option 1: use Twocheckout; ... Twocheckout::format('json'); Option 2: \Twocheckout::format('json'); For example,