承接 mikemix/dompdfmodule 相关项目开发

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

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

mikemix/dompdfmodule

最新稳定版本:3.0.0

Composer 安装命令:

composer require mikemix/dompdfmodule

包简介

DOMPDF Zend Framework lightweight module

README 文档

README

DOMPDF library wrapper as lightweight ZF2/ZF3 module.

Build Status

Requirements

Installation

Installation of DOMPDFModule uses PHP Composer. For more information about PHP Composer, please visit the official PHP Composer site.

Installation steps

  1. cd my/project/directory

  2. create a composer.json file with following contents:

    {
        "require": {
            "mikemix/dompdfmodule": "^3.0"
        }
    }
  3. install PHP Composer via curl -s http://getcomposer.org/installer | php (on windows, download http://getcomposer.org/installer and execute it with PHP)

  4. run php composer.phar install

  5. open my/project/directory/config/application.config.php and add the following key to your modules:

    'dompdfmodule',

Configuration options

You can override default options via the dompdf key in your local or global config files. See the dompdfmoule\Service\dompdfFactory.php file for the list of default settings.

Full list of possible settings is available at the official DOMPDF library site.

Example usage

Side note: use of getServiceLocator() in the controller is deprecated since in ZF3. Make sure you create your controller via a factory and inject the Dompdf object in the constructor.

<?php

// some controller

    public function indexAction()
    {
        /** @var \Dompdf\Dompdf $dompdf */
        $dompdf = $this->getServiceLocator()->get('dompdf');
        $dompdf->load_html('<strong>Ehlo World</strong>');
        $dompdf->render();

        file_put_contents(__DIR__ . '/document.pdf', $dompdf->output());
    }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-11-03