Build columns while running a query in yii2 -
create columns while running query in yii2
in controller : query :
$query=reports::find()->select(['report type','title','imagefile','id','body'])->where(['like', 'title',''.$test.'' ])->orderby('id desc');
i build column type not work.
for see result of alias should add in reports model public var same name value
class reports extends \yii\db\activerecord { public $type; .....
then can access value
$mymodels->type
Comments
Post a Comment