ActiveForm as a Component

Hello, i’m trying to use the ActiveForm as a Component, so i can later replace the ActiveForm for a Bootstrap ActiveForm or a Foundation ActiveForm.

The idea is to avoid the use the




use yii\widgets\ActiveForm; 



or


 

yii\widgets\ActiveForm::begin();



in the view files and use something like


 

Yii::$app->ActiveForm->begin();



Later if i decide to replace the ActiveForm class, i just have to change the

Yii::$app->ActiveForm Component class in configurations.

Is this a good idea ?

I’m having problems trying to make this work.

I think it’s not good idea, I have create it as Widget so you can change it as you like.

Why do you think is not a good idea ?

Lets assume that i want to create a product, like a CRM/ERP, so the code can be extended by others.

I have analysed Symfony and i like the idea that every bundle can be extended. I want to have the flexibility to change the active form or other stuff, just by changing the configurations of Components.

Yes, I know what you want.

and for me, I have extended ActiveForm and built ActiveForm Widget, but not Component, that’s what I mean :)