I want to have like condition with one % at the right:
`name` LIKE 'name%'
I have a code:
Model::find()->andWhere(['LIKE' ,'name',strtr($city_name,['%'=>'\%', '_'=>'\_', '\\'=>'\\\\']).'%', false]);
$city_name is a user input, so i escape some characters with strtr() and add % at the right.
And provide ‘false’ attribute to prevent future escaping of %_\ chars.
Is it a normal solution or there is a better way?