Answer the question
In order to leave comments, you need to log in
How to get application component id?
How to get the application component id inside the application itself?
For example, I connect a component to the application in the config:
'components' => [
'TestComponent' => [
'class' => 'app\components\MyComponent'
],
]
Answer the question
In order to leave comments, you need to log in
You need to take all the components and look for instanceof app\components\MyComponent
.
It is better to pass as a parameter what you need.
'components' => [
'TestComponent' => [
'class' => 'app\components\MyComponent',
'myProp' => 'Whatever you need' //myProp - публичное свойство компонента
],
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question