Hello,
I’m writing an extension that is made up of a few different class files, with a subdirectory or two.
From what I’ve seen of other extensions, they use Yii::import(), and specify the full path to whatever class file they want to load, eg. Yii::import(‘ext.yii-ext.authorname.myspecialsnowflake.behaviors.ClassNameHere’);
Trying to move these extensions out of their ridiculous directories into the root of extensions/ (or grouping them into extensions/behaviors/, for example) breaks everything, because Yii::import() is effectively a require() with absolute pathing.
I want to avoid this shtick with my own extension.
What’s the recommended way to import a class using a relative path, instead of the full ext.foo.bar absolute path?
(Require()? Have I missed something with Yii::import()?)
Edit: Damn, I think I should’ve posted this in Tips, Snippets and Tutorials. Could a mod move this, please? (Sorry.)
Edit #2: Thanks for the move.