shgnInc
shgnInc

Reputation: 2198

How to use widget by Yii CFrom

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?

Upvotes: 1

Views: 349

Answers (1)

DaSourcerer
DaSourcerer

Reputation: 6606

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.

Upvotes: 2

Related Questions