M
M
Michael2016-06-29 20:32:33
Yii
Michael, 2016-06-29 20:32:33

Do you need to create models?

Now I am writing an API for AngularJS on Yii2. Previously, I always used incoming parameters like this:

Yii::$app->getRequest()->getQueryParam('paramName')

And now I thought, maybe it would be more correct to create a model (with validations) for each method where reception of parameters is needed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Makarov, 2016-07-01
@SamDark

We create at home ... it is necessary to validate this way and that way, whether it is in the model or not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question