public function rules() {
return array(
array('username, password, email', 'required'),
array('username', 'unique', 'className'=>'Users', 'message'=>'Данный логин занят' ),
array('username', 'length', 'min'=>3, 'max'=>20),
array('email', 'email'),
array('password', 'length', 'min'=>5, 'max'=>100),
array('id, username', 'safe', 'on'=>'search'),
);
}
$form=$this->beginWidget('CActiveForm', array(
'id'=>'registr-form',
'enableClientValidation'=>true,
'action'=>Yii::app()->createUrl('/site/CreateProfil'),
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
));
echo '<label for="login">Логин:</label>';
echo $form->textField($model,'username', array('class'=>"input_text"));
echo $form->error($model,'username');
echo '<label for="password">Пароль:</label>';
echo $form->passwordField($model,'password', array('class'=>"input_text"));
echo $form->error($model,'password');
echo '<label for="login">E-mail:</label>';
echo $form->textField($model,'email', array('class'=>"input_text"));
echo $form->error($model,'email');
echo CHtml::submitButton('Создать', array('class'=>"btn"));
$this->endWidget();