weesee/yii2-pdflabel
Composer 安装命令:
composer require weesee/yii2-pdflabel
包简介
Extension to print labels with PDF
README 文档
README
Yii2 Widget to print labels on PDF
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist weesee/yii2-pdflabel "*"
or add
"weesee/yii2-pdflabel": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by:
View:
<?php echo Html::a("Download Label-PDF",['site/downloadpdf']); ?>
Controller (assuming we have a DataProvider $labelDataProvider
(here: an ArrayDataProvider) with models containing
name and town properties):
use weesee\pdflabel\PdfLabel;
...
public function actionDownloadpdf()
$pdfLabel = new PdfLabel([
'labelName' => '5160',
'dataProvider' => $labelDataProvider,
'renderLabel' => function($model, $key, $index) {
return $model["name"]."\n".$model["town"];
},
]);
return $pdfLabel->render();
Credits
Thanks for your great job which this Yii2-extension is build on:
Author / Licence
WeeSee weesee@web.de
GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007
统计信息
- 总下载量: 98
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2018-01-20