PHP code example of jobsys / print-module

1. Go to this page and download the library: Download jobsys/print-module library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jobsys / print-module example snippets


// Permission 添加权限
"page.manager.print.index" => [
	"display_name" => "打印设置",
	"children" => [
		"api.manager.print.template.edit" => "编辑打印模板",
		"api.manager.print.template.variable.edit" => "编辑打印模板参数",
		"api.manager.print.template.design.edit" => "设计打印模板",
		"api.manager.print.template.items" => "查看打印模板列表",
		"api.manager.print.template.item" => "查看打印模板详情",
		"api.manager.print.template.delete" => "删除打印模板",
		"api.manager.print.template.copy" => "复制打印模板",
	]
],


     return $print_service->print($template_id, $print_data);
   

      /**
      * 打印
      * @param int $template_id 打印模板id
      * @param object|array $data 打印数据, 如果为数组,表示打印多份
      * @return Response
       */
       public function print(int $template_id, object|array $data): Response
      
bash
# 安装依赖
composer  module:enable Print && php artisan migrate
bash
# 同步权限
php artisan permission:sync