本文整理汇总了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");
}
示例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);