I'm building a REST API extension and it has three sub classes.
CApplicationComponent
|
APIComponent
|
– SpecificAPIGeneric
|
---- MoreSpecificAPICall_A
|
---- MoreSpecificAPICall_B
|
---- MoreSpecificAPICall_C
The "Generic" base class is where all the configuration parameters need to be set (i.e. API url, API key, etc.)
In my main.php, I've created a component section for my base class. However, no matter what I try, the parameters are not read at runtime.
So my question is this: must I create a component config for the class I'm actually using instead of the parent class? More directly, will the framework retrieve configuration parameters for the parent component as well as the instantiated component?
If Yii doesn't do this, is it something that should be considered in an upcoming release?
What do you mean by parent and child components here? Do you have both of them during runtime, or are they merely parent-child inheritance relationship?
Because Yii configuration is really about setting property initial values, a child component can always inherit the parent component's properties and thus can be configured.
What do you mean by parent and child components here? Do you have both of them during runtime, or are they merely parent-child inheritance relationship?
Because Yii configuration is really about setting property initial values, a child component can always inherit the parent component's properties and thus can be configured.
By parent/child I mean that I want to set params for the base class of my instantiated, not the instantiated class itself. The subclasses all share the same info. I don't want to set it three times.
I have my class config info (main.php) under the components area. However, what I've made is an "extension". Should it be a component? I'm unclear on the distinction.
In any case, should I add an 'extensions' section to the main.php to get the config params to be recognized?