Advanced application template.
I have a module in common\modules\setting\Module
A component is required. Inside the module I make the "components" folder: common\modules\setting\components In this folder I put a file named SettingComponent.php File contents:
namespace common\modules\setting\components; use yii\base\Component; class SettingComponent extends Component { // some code... } In common\config\main.php I connect the component as follows:
[ 'components' => [ 'setting' => [ 'class' => 'common\modules\setting\components\SettingComponent', ], // ... ], ]; As a result, I get the error:
ReflectionException Class common\modules\setting\components\SettingComponent does not exist Here is the hierarchy just in case:
What am I doing wrong?


components, but inmodules? yiiframework.com/doc-2.0/… ......... youtu.be/GtHB58-JA38 - Alexey Shimansky'setting' => [ 'class' => common\modules\setting\Module::className() ]I need so that I can access this component anywhere in the application like this:\Yii::$app->setting- LostDok 2:19 pm