Answer the question
In order to leave comments, you need to log in
How to inject a third party component in Yii2 that doesn't use namespaces?
I can't embed a component in Yii2 at all. It's from an old project, namespaces are not used. I connected it like this:
$phprtf = Yii::getAlias('@app') . '/extensions/phprtf/PHPRtfLite.php';
include($phprtf);
$rtf = new \PHPRtfLite();
$rtf->setLandscape();
$rtf->setMarginLeft(0.5);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question