承接 krona/wkhtml-module 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

krona/wkhtml-module

Composer 安装命令:

composer require krona/wkhtml-module

包简介

ZF2 Module for Wkhtmltopdf

README 文档

README

Krona WKHTML is an ZF2 Module for simplify working with PDF generation

Install

Composer

Install Composer Composer:

$ curl -s https://getcomposer.org/installer | php

Add requirements to composer.json:

{
    "require": {
        "krona/wkhtml-module": "dev-master"
    }
}

Configuration

In your application config add module:

<?php
return [
    // This should be an array of module namespaces used in the application.
    'modules' => [
        'Krona\CommonModule',
        'Krona\WKHTML',
        ...
    ],
    ...
],

If you want to use lib with ability to send PDF directly to user from Action register Strategy inside global config:

'view_manager' => [
    'strategies' => [
        \Krona\WKHTML\Strategy\PdfStrategy::class,
    ],
],

Also you need to add config for placement and base URL for temporary location of HTML for example:

    'krona' => [
        'wkhtml' => [
            'dir' => 'public/placement/',
            'base_url' => 'http://my.domain/placement/'
        ],
    ],

Usage

Simple use with sending PDF to user

class SomeController extends AbstractController
{
    public function testAction()
    {
        //...
        $view = new PdfModel( //The same as ViewModel
            [
                
            ]
        );
        $view->setOrientation(PdfModel::ORIENTATION_LANDSCAPE);
        
        return $view;
    }
}

统计信息

  • 总下载量: 53
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-04