ببخشید استاد خیلی متوجه نشدم ...
الان این مدل صفحه ثبت نام :
<h2>Hi !</h2>
<?php
use yiiwidgetsActiveForm;
use yiihelpersHtml;
?>
<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>
<?=$form->field($model,'firstName'); ?>
<?=$form->field($model,'lastName'); ?>
<?=$form->field($model,'userName'); ?>
<?=$form->field($model,'passWord'); ?>
<?=$form->field($model,'avatar')->fileInput() ?>
<?=Html::submitButton('Submit'); ?>
<?php ActiveForm::end(); ?>
این مدل Registration :
<?php
namespace frontendmodels;
use yiibaseModel;
class RegisterationForm extends Model
{
public $firstName;
public $lastName;
public $userName;
public $passWord;
public $avatar;
public function rules()
{
return[
[['firstName','lastName','userName','passWord'],'required'],
['passWord','integer'],
['avatar','file']
];
}
}
?>
این هم برای مدل ثبت کردن :
<?php
namespace frontendmodels;
use yiidbActiveRecord;
class Registeration extends ActiveRecord
{
public function rules()
{
return[
[['firstName','lastName','userName','passWord'],'required'],
['passWord','integer'],
['avatar','file']
];
}
}
?>
ممنون می شم کمک کنید ...