2checkout

Using classes without namespace with Yii2

倾然丶 夕夏残阳落幕 提交于 2019-11-30 08:57:42
问题 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,

Using classes without namespace with Yii2

旧街凉风 提交于 2019-11-29 09:33:45
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. arogachev 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, PHPExcel extension also doesn't have namespaces, similar question was answered on official forum .