dino/dompdf-module
Composer 安装命令:
composer require dino/dompdf-module
包简介
A Zend Framework 2 module for incorporating DOMPDF support.
README 文档
README
The DOMPDF module integrates the DOMPDF library with Zend Framework 2 with minimal effort on the consumer's end.
Requirements
Installation
Installation of DOMPDFModule uses PHP Composer. For more information about PHP Composer, please visit the official PHP Composer site.
Installation steps
-
cd my/project/directory -
create a
composer.jsonfile with following contents:{ "require": { "dino/dompdf-module": "dev-master" } } -
install PHP Composer via
curl -s http://getcomposer.org/installer | php(on windows, download http://getcomposer.org/installer and execute it with PHP) -
run
php composer.phar install -
open
my/project/directory/config/application.config.phpand add the following key to yourmodules:'DOMPDFModule',
Configuration options
You can override options via the dompdf_module key in your local or global config files. See DOMPDFModule/config/module.config.php for config options.
Usage
<?php namespace Application\Controller; use Zend\Mvc\Controller\AbstractActionController; use DOMPDFModule\View\Model\PdfModel; class ReportController extends AbstractActionController { public function monthlyReportPdfAction() { $pdf = new PdfModel(); $pdf->setOption('fileName', 'monthly-report'); // "pdf" extension is automatically appended $pdf->setOption('display', PdfModel::DISPLAY_ATTACHMENT); // Triggers browser to prompt "save as" dialog $pdf->setOption('paperSize', 'a4'); // Defaults to "8x11" $pdf->setOption('paperOrientation', 'landscape'); // Defaults to "portrait" // To set view variables $pdf->setVariables(array( 'message' => 'Hello' )); return $pdf; } }
Development
So you want to contribute? Fantastic! Don't worry, it's easy. Local builds, tests, and code quality checks can be executed using Docker.
Quick Start
- Install Docker CE.
- Run the following from your terminal:
docker build -t dino/dompdf-module .
docker run -v composer-cache:/var/lib/composer -v ${PWD}:/opt/app dino/dompdf-module
Super easy, right? Here's a quick walk through as to what's going on.
docker build -t dino/dompdf-module .builds a docker image that will be used for each run (i.e. each timedocker runis executed) and tags it with the namedino/dompdf-module.docker run -v composer-cache:/var/lib/composer -v ${PWD}:/opt/app dino/dompdf-moduleruns the default build in a new Docker container derived from the image taggeddino/dompdf-module. The root of the project and PHP Composer cache volume are mounted so that artifacts generated during the build process are available to you on your local machine.
Note: You only need to run the first command once in order to build the image. The second command is what executes the build (build, tests, code quality checks, etc.).
Other Supported PHP Versions
By default, builds executed using Docker are done so using the latest stable version of PHP. If you're adventurous you can execute builds against other supported versions of PHP.
PHP 5.6
docker build --build-arg PHP_VERSION=5.6 --tag dino/dompdf-module-php56 .
docker run -v composer-cache:/var/lib/composer -v ${PWD}:/opt/app dino/dompdf-module-php56
To-do
- Add command line support.
dino/dompdf-module 适用场景与选型建议
dino/dompdf-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 469.15k 次下载、GitHub Stars 达 61, 最近一次更新时间为 2012 年 06 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「zf2」 「pdf」 「dompdf」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dino/dompdf-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dino/dompdf-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dino/dompdf-module 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
LosLog provides some log utility
A Laminas module for incorporating DOMPDF support - Originally by Raymond Kolbe
EdpModuleLayouts is very simple Laminas module for making module-specific layouts insanely easy.
A fork of barryvdh/laravel-dompdf with no PNG alpha processing. A DOMPDF Wrapper for Laravel
Zend Framework module to leverage the symfony dependency injection container
RCM User HTML views/pages
统计信息
- 总下载量: 469.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 61
- 点击次数: 34
- 依赖项目数: 8
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-06-30