/**
* 下载作文内容到doc文件
*/
public function actionSaveCompositionWord()
{
//加载数据模型
$model = $this->loadModel();
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$wordStr = '<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head><STYLE>BR.page { page-break-after: always }</STYLE></head><body>';
$wordStr .= $model->content;
$wordStr .= '</body></html>';
$fileName = $model->composition_name . '_' . $model->real_name;
//防止导出乱码
$file = iconv("utf-8", "GBK", $fileName);
header("Content-Type: application/doc");
header("Content-Disposition: attachment; filename=" . $file . ".doc");
echo $wordStr;
}
* 下载作文内容到doc文件
*/
public function actionSaveCompositionWord()
{
//加载数据模型
$model = $this->loadModel();
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$wordStr = '<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head><STYLE>BR.page { page-break-after: always }</STYLE></head><body>';
$wordStr .= $model->content;
$wordStr .= '</body></html>';
$fileName = $model->composition_name . '_' . $model->real_name;
//防止导出乱码
$file = iconv("utf-8", "GBK", $fileName);
header("Content-Type: application/doc");
header("Content-Disposition: attachment; filename=" . $file . ".doc");
echo $wordStr;
}