我正在调用未知方法:app \ modules \ employee \ models \ NewEmployeeForm :: save()尝试执行$ model-> save();
我假设save()方法是继承自Model,但后来发生了这种情况。我需要编写自己的保存方法吗?我想遵循yii2的做事方式。下面是我的模特
提前致谢
use common\models\User;
use yii\base\Model;
use Yii;
/**
* Signup form
*/
class NewEmployeeForm extends Model
{
public $nik;
public $pin;
public $company_id;
public $category_id;
public $first_name;
public $last_name;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['pin', 'company_id', 'category_id'], 'integer'],
[['nik'], 'string', 'max' => 255],
[['first_name', 'last_name'], 'string', 'max' => 255],
];
}
}