當前位置: 首頁>>代碼示例>>PHP>>正文


PHP pdf::render方法代碼示例

本文整理匯總了PHP中pdf::render方法的典型用法代碼示例。如果您正苦於以下問題:PHP pdf::render方法的具體用法?PHP pdf::render怎麽用?PHP pdf::render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pdf的用法示例。


在下文中一共展示了pdf::render方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 function print_leave()
 {
     //call session
     $data['id_users'] = $this->session->userdata('id_users');
     $data['user_type'] = $this->session->userdata('user_type');
     if ($data['user_type'] == 'staff') {
         //get users details staff
         $table = 'users';
         $tableNameToJoin = array('staff');
         $tableRelation = array('users.id_users = staff.id_users');
         $where = array('users.id_users' => $data['id_users']);
         $data['rsProfile'] = $this->m_query->get_specified_row($table, $where, $tableNameToJoin, $tableRelation);
     } else {
         redirect('users/login', 'refresh');
     }
     $id_apply_leave = $this->uri->segment(4);
     //get tahun semasa
     $table_year = date("Y");
     //get staff id_users
     $table = 'apply_leave';
     $tableNameToJoin = array('staff', 'leave_staff');
     $tableRelation = array('staff.id_users = apply_leave.id_users', 'apply_leave.id_users = leave_staff.id_users');
     $where = array('apply_leave.id_apply_leave' => $id_apply_leave, 'leave_staff.table_year' => $table_year);
     $data['detail_staff'] = $this->m_query->get_specified_row($table, $where, $tableNameToJoin, $tableRelation);
     if ($data['detail_staff']['gender'] == 'Female') {
         $table = "apply_leave";
         $tableNameToJoin = array('staff', 'leave_name_female');
         $tableRelation = array('apply_leave.id_users = staff.id_users', 'apply_leave.leave_code = leave_name_female.leave_code');
         $where = array('id_apply_leave' => $id_apply_leave);
         $data['apply_leave'] = $this->m_query->get_specified_row($table, $where, $tableNameToJoin, $tableRelation);
     } else {
         if ($data['detail_staff']['gender'] == 'Male') {
             $table = "apply_leave";
             $tableNameToJoin = array('staff', 'leave_name_male');
             $tableRelation = array('apply_leave.id_users = staff.id_users', 'apply_leave.leave_code = leave_name_male.leave_code');
             $where = array('id_apply_leave' => $id_apply_leave);
             $data['apply_leave'] = $this->m_query->get_specified_row($table, $where, $tableNameToJoin, $tableRelation);
         }
     }
     $p = new pdf();
     $p->load_view('admin/v_print_leave', $data);
     $p->set_paper('c4', 'potrait');
     $p->render();
     $p->stream("download.pdf", array('Attachment' => 0));
     $p->stream("maklumat_permohonan.pdf");
 }
開發者ID:metallurgical,項目名稱:eock,代碼行數:46,代碼來源:leave.php

示例2: define

<?php

require '../vendor/autoload.php';
/* JABH creamos una funcion en App
define('DOMPDF_ENABLE_AUTOLOAD', false);
require_once '../vendor/dompdf/dompdf/dompdf_config.inc.php';

*/
$data = array('nombre' => 'Jonny Alexander Berrio', 'curso' => 'Laravel 5');
/* JABH creamos una funcion en App

ob_start();
extract($data);
include '../templates/pdf/certificate-2.php';
$html= ob_get_clean();

*/
require_once '../app/template.php';
$html = template::render('pdf/certificate-2', $data);
/* JABH creamos una funcion en App
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
*/
require_once '../app/pdf.php';
pdf::render('certificate-2', $html);
開發者ID:jonnyalexbh,項目名稱:stydeComposer,代碼行數:27,代碼來源:download-2.php


注:本文中的pdf::render方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。