restlin/grid

带有功能的 Yii2/Grid 小部件

安装: 16

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放性问题: 0

类型:yii2-extension

1.0.8 2018-02-12 15:14 UTC

This package is auto-updated.

Last update: 2024-09-21 15:32:57 UTC


README

Yii2 小部件 - 是一个具有默认功能的网格小部件。这个小部件支持从外部更改页面大小,从 Dosamigos\grid\GroupGridView 功能中分组,并导出为 PDF。

要导出为 PDF,您必须设置 pdfAction(默认为 site/pdf)。

示例动作代码(不理想)

public function actionPdf($format = 'A4')
{    
    $html = Yii::$app->request->post('html','no data');
    $pdf = new \mPDF;
    $pdf->setFooter('page.{PAGENO} of {nb}');
    $pdf->AddPageByArray(['newformat' => $format]);
    $css = '<link rel="stylesheet" type="text/css" href="css/print.css"/>'; //example css
    $pdf->writeHtml($css.$html);
    $pdf->Output("output.pdf", "I");
}