File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ PHP_METHOD(vtiful_xls, fileName)
155155
156156 ZEND_PARSE_PARAMETERS_START (1 , 2 )
157157 Z_PARAM_STR (zs_file_name )
158+ Z_PARAM_OPTIONAL
158159 Z_PARAM_STR (zs_sheet_name )
159160 ZEND_PARSE_PARAMETERS_END ();
160161
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Check for vtiful presence
3+ --SKIPIF--
4+ <?php if (!extension_loaded ("xlswriter " )) print "skip " ; ?>
5+ --FILE--
6+ <?php
7+ $ config = ['path ' => './tests ' ];
8+ $ excel = new \Vtiful \Kernel \Excel ($ config );
9+
10+ $ fileObject = $ excel ->fileName ("tutorial01.xlsx " );
11+
12+ $ fileObject ->header (['name ' , 'age ' ])
13+ ->data ([['viest ' , 21 ]])
14+ ->data ([['wjx ' , 21 ]]);
15+
16+ $ filePath = $ fileObject ->output ();
17+
18+ var_dump ($ filePath );
19+ ?>
20+ --CLEAN--
21+ <?php
22+ @unlink (__DIR__ . '/tutorial01.xlsx ' );
23+ ?>
24+ --EXPECT--
25+ string(23) "./tests/tutorial01.xlsx"
You can’t perform that action at this time.
0 commit comments