Модель
Код: Выделить всё
class RegisterFrom extends \yii\base\Model {
public function rules() {
return [
['name', 'required'],
['social', 'socialValidate'],
];
}
public function socialValidate() {
// ....
}
}
Код: Выделить всё
<?
// RegisterFrom $model;
?>
<?php $form = \yii\widgets\ActiveForm::begin(); ?>
<?= $form->field($model, 'name'); ?>
<?= $form->field($model, 'social[vk]'); ?>
<?= $form->field($model, 'social[fb]'); ?>
<?php \yii\widgets\ActiveForm::end(); ?>