Answer the question
In order to leave comments, you need to log in
How to change field names in yii2?
Hello.
How to specify a new field name in the query builder?
This is the source code
$query = News::find()
->select(['name', 'SUBSTRING(`text`, 1, 256 ) as `text`', 'date', 'id'])
->where($where['where'], $where['arr']);
'SUBSTRING(`text`, 1, 256 ) as `text2`'
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