Answer the question
In order to leave comments, you need to log in
Business logic and model parameters in yii?
Interested in the opinion of how best to build model methods in yii.
There are many examples where they do something like this:
$model->a = $_POST['Model']['a'];
$model->b = $_POST['Model']['a'];
и тд.. либо через массовое присовение $model->attributes = $_POST['Model];
и потом вызов:
$model->create();
$model->create($_POST['Model']['a'],$_POST['Model']['b']);
Внтури уже метод:
function create($a,$b)
{
$this->a = $a;
$this->b = $b;
return $this->save();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question