How do i create an alias that allows me make use of an external class within my YII2 controller.
My external class is two folders before my YII2 project.
This is what i have done so far.
In my YII entry script i have this
Yii::setAlias(’@externalclass’, DIR . ‘\includes\utility.php’);
while inside a particular method in my controller i have this
echo Yii::getAlias(’@externalclass’);
this only displays the file path.
I want to be able to instantiate the external class and use its methods.