L
L
Lander2015-08-13 11:23:10
Yii
Lander, 2015-08-13 11:23:10

What can be improved in the component code?

Recently I work on yii2, so I still have very little knowledge of its features. Here it was required to write a component. I ask the gurus for help, what can be improved and how to write components for yii2 in general? Any criticism, even the smallest, is welcome.
Component code: https://github.com/nplander/yii2-robokassa-compone...
Thank you in advance for your time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Khomenko, 2015-08-13
@usdglander

As far as I can see, you don't have to inherit yii\base\Component, yii\base\Object is enough. Component adds behavior (Behavior) and events (Event) to the object. You seem to use only the "magic" configuration that is in Object.
Also, I would place all the parameters of the component in config/main.php or in main-local.php, and would access it through Yii::$app->robokassa->... but this is subjective.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question