How to use widget by Yii CFrom

357 Views Asked by At

I have a CForm which is instantiate in a controller. Now I need to use some widgets as its element, even by validations and more capabilities. Who to do that?

1

There are 1 best solutions below

1
On BEST ANSWER

Validations are something that belong into the realm of the injected model. It is not the duty of CFormto perform any input validation/sanitization.

As for widgets, see this part of the guide. Just before the section "Specifying Static Text," there is a whole bunch of informations on how to integrate widgets extending either CInputWidget or CJuiInputWIdget.