承接 carlescliment/html2pdf-bundle 相关项目开发

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

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

carlescliment/html2pdf-bundle

Composer 安装命令:

composer require carlescliment/html2pdf-bundle

包简介

Integrates the html2pdf REST service in Symfony 2

README 文档

README

Build Status

This is a Symfony 2 client for the Html2Pdf REST Service.

Installation

Include the bundle in your composer.json file.

    "require": {
        ...
        "carlescliment/html2pdf-bundle": "dev-master"
    }

Modify your AppKernel:

    public function registerBundles()
    {
        $bundles = array(
            // ...
            new carlescliment\Html2PdfServiceBundle\carlesclimentHtml2PdfServiceBundle(),
        );

Set the bundle configuration in your config.yml:

parameters:
    html2pdf.host: http://html2pdf.mydomain.com
    html2pdf.port: 80

Execute php composer.phar update carlescliment/html2pdf-bundle

Usage

From your controller, render the template and pass it to the service:

class SampleController extends Controller
{
    public function toPdfAction()
    {
        $view = $this->renderView('YourBundle:Sample:toPdf.html.twig');
        $bridge = $this->get('html2pdf.bridge');
        $options = array('footer-left' => 'my footer');
        return $bridge->getFromHtml($view, 'document_name', $options);
    }
}

Testing

Execute phpunit in the bundle's root dir to run the tests.

If you need functional or integration tests and don't want to make real curl requests, you can use the NullProtocol in order to disable them. Put this configuration in your config_test.yml file.

html2pdf.protocol:
    class: carlescliment\Html2PdfServiceBundle\Protocol\NullProtocol

TO-DO

  • Port setting is currently being ignored

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2013-10-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固