CForm getActiveFormWidget always returns NULL

As titled, CForm’s getActiveFormWidget always returns NULL, tried calling it in a controller, a class inherited from CForm.

$preSignupForm = new CForm('user.views.forms.preSignupForm', new UserPreSignupForm());

var_dump($preSignupForm->getActiveFormWidget());//returns NULL

The form renders and works, no error messages though. Am I missing something? Can somebody verify this for me?

tested on Yii version 1.1.4 and nightly snapshot, someone please verify this for me.

Now I get it, getActiveFormWidget only returns the current activeForm after the form is rendered. Anyway to get the activeFormWidget before it is rendered?

I get it, I just overwrite CForm’s render to run my codes and its parent, solve!

Thanks! :lol: