ResponseHeaderUtils::setXlsHeader()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace Ridibooks\Platform\Common;
4
5
class ResponseHeaderUtils
6
{
7
	/**
8
	 * 윈도우환경에서 html table 전송하되, 엑셀에서 열릴 수 있게할떄 설정하는 헤더
9
	 *
10
	 * @param $file_name
11
	 */
12
	public static function setXlsHeader($file_name)
13
	{
14
		header("Content-Type: application/vnd.ms-excel;charset=utf-8");
15
		header("Content-Disposition: attachment; filename=\"$file_name.xls\"");
16
		header('Cache-Control: max-age=0');
17
	}
18
}
19