0

Quite simply, what is the difference between using CHtml::textField or CHtml::activeTextField, as well as other Yii CHtml form inputs.

When is it appropriate to use active vs normal form inputs.

ThorSummoner
  • 16,657
  • 15
  • 135
  • 147

1 Answers1

4

The non-active versions are used without a model reference. The active versions all take a model instance as their first argument.

By having a model instance tied to the form each field has the model's definition, its labels, validation routines tied to the form. It also will be pre-populate fields when updating data.

Jonnny
  • 4,939
  • 11
  • 63
  • 93