I had a problem importing php files.
Why does it work:
include( Yii::getPathOfAlias( 'ext.payu.payU').'.php' );
but this is not so:
Yii::import( 'ext.payu.payU');
?
payU.php file:
include_once( dirname(__FILE__) . "/sdk/openpayu.php"); //this is a valid path class payU{ }
Try Yii::import('ext.payu.payU', true) , because by default a one-parameter call to the Yii::import() function means:
Yii::import('ext.payu.payU', true)
Yii::import()
Hey, just add this path to the list of known aliases and don't require() now
require()
and you need to do new payU() for this.
new payU()
Import works as follows: Open the directory and load the class into a php file; state: class name is the index of the file name.
Instead of Include, loads all classes in a php file
Source: https://habr.com/ru/post/924714/More articles:Call C # webservices from javascript and use it (json format) - javascriptHow to list all folders and files in a directory after connecting via SFTP in Python - pythonFailed to align views - androidPassing an array of arguments on the command line - c #Process.Start - pass exe html code as an argument - c #How to log in? Django TastyPie with the actual authentication procedure ApiKeyAuthentication - authenticationMagento - split versions of container1 and container2 - htmlServer sent events, but with a big delay - phpCoreAnimation: warning, remote stream with uncommitted CATransaction - objective-cSymfony Twig Forms. Defining specific fields - symfonyAll Articles