aldaflux/doc-img-bundle
Composer 安装命令:
composer require aldaflux/doc-img-bundle
包简介
Symfony Bundle for test
README 文档
README
Insert into AppKernel.php
new Aldaflux\DocImgBundle\AldafluxDocImgBundle(),
Insert into config.yml...
aldaflux_doc_img:
web_dir: "%kernel.root_dir%/../web"
and verify this :
framework:
templating:
engines: ['twig']
in your template :
<img src="/bundles/aldafluxdocimg/images/inda.png">
<img src="https://upload.wikimedia.org/wikipedia/fr/thumb/9/94/Logo_Microsoft_Word_2013.png/220px-Logo_Microsoft_Word_2013.png">
IMPORTANT ! : use double quote, simple quote don't work...
in your controller :
$view_html = $this->renderView('AldafluxDocImgBundle:Default:example.html.twig');
$view_mht=$this->get('HtmlToMht')->GenereHtmlToMht($view_html);
you can write the view in a file (".doc") or send it in response
$response = new Response();
$response->headers->set('Cache-Control', 'private');
$response->headers->set('Content-type', "application/vnd.ms-word");
$response->headers->set('Content-Disposition', 'attachment; filename="file.doc"');
$response->sendHeaders();
$response->setContent($view_mht);
return ($response);
If you want test fonctionality , add this to routing.yml:
aldaflux_doc_img:
resource: "@AldafluxDocImgBundle/Controller"
type: annotation
and go to http://yourserver/aldaflux/
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2018-11-06