Skip to content

raykolbe/DOMPDFModule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DOMPDFModule

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

  1. cd my/project/directory

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

    {
        "require": {
            "dino/DOMPDFModule": "dev-master"
        }
    }
  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

Copy dino/DOMPDFModule/config/module.dompdf.local.php to my/project/directory/config/autoload/module.dompdf.local.php and reference dino/DOMPDFModule/config/module.config.php for configration options that you can override.

Usage

<?php

namespace Application\Controller;

use Zend\Mvc\Controller\ActionController;
use DOMPDFModule\View\Model\PdfModel;

class ReportController extends ActionController
{
    public function indexAction()
    {
        return new PdfModel(); // Takes same params as Zend\View\Model\ViewModel
    }
}

To-do

  • Create tests
  • Add support for DOMPDF CLI
  • Add support for Content-Disposition header

About

A Zend Framework module for Dompdf

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5