I
I
Ivan Kolesnik2021-03-05 18:11:27
Yii
Ivan Kolesnik, 2021-03-05 18:11:27

Is it necessary to always bind user input in Yii2?

Given: some user input (let it be $somethingfrom $_POST, minimally cleared with strip tags, after - htmlspecialchars) We

search using Active Record:

Model::find()->where(['something' => $something])->all();


I observed that some comrades constantly use ->bind, but, as far as I remember, it comes in this form by default with where() conditions

. Is this true or is it still worth binding? Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kholmurod Isroilov, 2021-04-28
@khalmurad

6088bf8769ece272912784.jpeg
Read more:
https://www.yiiframework.com/doc/guide/2.0/en/db-q...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question