Получить render запрашиваемого формата
Добавлено: 2019.10.19, 22:02
Добрый вечер всем.
Помогите пожалуйста, понять что я делаю не так?
Хочу определить формат и перенаправить на render, а получаю null, т.е пустую страницу.
$format = $this->renderSamsung($channels, $key);
$index = $this->renderIndex($channels, $key);
if ($index === 'siptv') {
$index = $this->renderIndex($channels, $key);
return Yii::$app->response->sendContentAsFile($index, $user->username . '.playlist.m3u8', [
'mimeType' => 'application/vnd.apple.mpegurl',
'inline' => false,
]);
}
if ($format === 'samsung') {
$format = $this->renderSamsung($channels, $key);
return Yii::$app->response->sendContentAsFile($format, $user->username . '.nStream.xml', [
'mimeType' => 'application/vnd.apple.mpegurl',
'inline' => false,
]);
}
Помогите пожалуйста, понять что я делаю не так?
Хочу определить формат и перенаправить на render, а получаю null, т.е пустую страницу.
$format = $this->renderSamsung($channels, $key);
$index = $this->renderIndex($channels, $key);
if ($index === 'siptv') {
$index = $this->renderIndex($channels, $key);
return Yii::$app->response->sendContentAsFile($index, $user->username . '.playlist.m3u8', [
'mimeType' => 'application/vnd.apple.mpegurl',
'inline' => false,
]);
}
if ($format === 'samsung') {
$format = $this->renderSamsung($channels, $key);
return Yii::$app->response->sendContentAsFile($format, $user->username . '.nStream.xml', [
'mimeType' => 'application/vnd.apple.mpegurl',
'inline' => false,
]);
}