denisristic/word-service-provider 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

denisristic/word-service-provider

Composer 安装命令:

composer require denisristic/word-service-provider

包简介

A wrapper for PHPWord usage in Silex 2 projects

README 文档

README

Introduction

This service provider for Silex allows you to quickly generate Word (*.doc) documents. Either pass in a query result set, and a list of headers, or use the Doctrine functionality to convert a html to a document.

Installation

Require the provider using composer:

    composer require denisristic/word-service-provider

Register the provider in your application somewhere:

    $app->register(new \denisristic\WordServiceProvider\Provider\WordServiceProvider());

Usage

Generate a document from HTML:

        $word = $app['word']->generateDOC('<h1>Test HTML header</h1>');

Forcing a download of the spreadsheet:

        $controllers->get('/download', function () use($app) {
        
            $word = $app['word']->generateDOC('<h1>Test HTML header</h1>');

            $docName = 'entries-' . date('Y-m-dhis') . '.doc';
            $response = new Response($word);
            $response->headers->add(array(
                'Content-Type' => 'application/vns.ms-word'
                ,'Content-Disposition' => 'inline; filename="' . $docName . '"'
                ,'Pragma' => 'no-cache'
                ,'Expired' => 0
            ));
            return $response;
                
        })->bind('download');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固