restlin / grid
Yii2/Grid widget with features
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- 2amigos/yii2-grid-view-library: ~0.1.1
- mpdf/mpdf: >=6.1.1
- yiisoft/yii2: *
README
Yii2 widget - is a default grid with features. This widget support changing page size from outbox, grouping features from Dosamigos\grid\GroupGridView and export to pdf.
For export to pdf you must set pdfAction (default - site/pdf).
Example action code (not ideal):
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"); }