:::

8-3-2 寫入 PDF 設定

您沒有觀看影片的權限

您沒有觀看影片的權限

請先登入,登入後,確認您的權限後,即可觀看影片。

  1. index.php 加入對應流程:
    //儲存pdf的匯出設定
    case 'tad_signup_data_pdf_setup_save':
        Tad_signup_data::pdf_setup_save($action_id, $pdf_setup_col);
        header("location: pdf_signup.php?id=$action_id");
        exit;

     

  2. 記得過濾變數:
    $pdf_setup_col = Request::getString('pdf_setup_col');

     

  3. class\Tad_signup_data.php 加入對應方法:
    //儲存pdf的匯出設定
    public static function pdf_setup_save($action_id, $pdf_setup_col = '')
    {
        $TadDataCenter = new TadDataCenter('tad_signup');
        $TadDataCenter->set_col('pdf_setup_id', $action_id);
        $TadDataCenter->saveCustomData(['pdf_setup_col' => [$pdf_setup_col]]);
    }

     

  4. 順便完成 pdf_setup 方法
    //進行pdf的匯出設定
    public static function pdf_setup($action_id)
    {
        global $xoopsTpl;
    
        $action = Tad_signup_actions::get($action_id);
        $xoopsTpl->assign('action', $action);
    
        $TadDataCenter = new TadDataCenter('tad_signup');
        $TadDataCenter->set_col('pdf_setup_id', $action_id);
        $pdf_setup_col = $TadDataCenter->getData('pdf_setup_col', 0);
        $to_arr = explode(',', $pdf_setup_col);
    
        // 製作標題
        $head_arr = self::get_head($action);
        $from_arr = array_diff($head_arr, $to_arr);
    
        $hidden_arr = [];
    
        $tmt_box = Tmt::render('pdf_setup_col', $from_arr, $to_arr, $hidden_arr, true, false);
        $xoopsTpl->assign('tmt_box', $tmt_box);
    }

     

link to https://github.com/tadlearn/tad_signup/commit/176afe2c19f39990c53db498fb2507f271ac3314 \


:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.net%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1778%26tbsn%3D48

書籍目錄

展開 | 闔起

線上使用者

50人線上 (12人在瀏覽線上書籍)

會員: 0

訪客: 50

更多…