This somewhat relates to my earlier issue https://forum.yiiframework.com/t/firefox-adding-html-to-excel-file-when-direct-opening/127322/2.
I am learning more and more it is critical to set the Reponse Format when returning values from the controller, but I notice, the gii generated controller never specify the format?
In its simplest form, we have something like
public function actionIndex()
{
$searchModel = new ModelNameSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
I’m just curious, should the Response Format be specified here as well?
Is there a default format applied when none is explicitly specified?
If so, what is it and where is it set?
Thank you for helping clarify this issue for me. Your assistance is greatly valued!