跳至主內容區

XOOPS輕鬆架

:::

主內容區域

選擇後會自動跳轉頁面

2-2 套用樣板

  1. 好處是不用全部都用程式來寫,可以自己設定好各種花俏的格式,程式只負責把值填上
    <?php
    
    require 'vendor/autoload.php';
    
    $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load('test.xlsx');
    
    $worksheet = $spreadsheet->getActiveSheet();
    
    $worksheet->getCell('A1')->setValue('套用樣板測試');
    
    header('Content-Type: application/vnd.ms-excel');
    header('Content-Disposition: attachment;filename="套用樣板測試.xls"');
    header('Cache-Control: max-age=0');
    
    $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
    $writer->save('php://output');
    

     

  2. 簡單的樣板:text.xlsx
選擇後會自動跳轉頁面

:::

左邊區域內容

書籍目錄

展開 | 闔起

快速登入


右邊區域內容

請掃此 QR Code 可連至此頁面

計數器

今天: 1080108010801080
昨天: 2059205920592059
總計: 9353764935376493537649353764935376493537649353764

頁尾區域