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

1.0.8 2018-02-12 15:14 UTC

This package is auto-updated.

Last update: 2024-04-21 14:41:56 UTC


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");
}