constMemory_demo.php 459 B

12345678910111213141516
  1. <?php
  2. /**
  3. * 固定内存模式demo
  4. */
  5. require_once(__DIR__ . '/../vendor/autoload.php');
  6. use Pxlswrite\Pxlswrite;
  7. $fileObj = new Pxlswrite(['path' => __DIR__ . '/uploads']);
  8. $fileObj->constMemory('constMemory.xlsx');
  9. $fileObj
  10. ->setRow('A1', 50, ['bold'=>true,'align'=>[Pxlswrite::FORMAT_ALIGN_CENTER,Pxlswrite::FORMAT_ALIGN_VERTICAL_CENTER]]) // 写入数据前设置行样式
  11. ->header(['name', 'age'])
  12. ->data([['viest', 21]])
  13. ->output();