hbalkhi/yii2-pdf

Yii2 TCPDF to load TCPDF libraries in a Yii2 site.

Installs: 4 651

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2015-12-05 13:44 UTC

This package is not auto-updated.

Last update: 2022-07-23 07:07:55 UTC


README

Yii2 TCPDF to load TCPDF libraries in a Yii2 site

CHANGELOG

  • 0.3 - Added example
  • 0.2 - Loaded tcpdf_6_0_075
  • 0.1 - Initial Releases

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require hbalkhi/yii2-pdf "dev-master"

or add

"hbalkhi/yii2-pdf": "dev-master"

to the require section of your composer.json file.

CONFIGURATION

  • Add in your configuration file, in component section:
    'component' => [ 
    ...
    		// Yii2 TCPDF
    		'tcpdf' => [
    			'class' => 'hbalkhi\tcpdf\TCPDF',
    		],
    		...
    ]
  • Add in your SiteController the action:
    public function actionTcpdf()
        {
    		return $this->render('tcpdf');
    	}
  • Add in your view/site folder the file tcpdf.php from example folder
  • Now you can view the example at the links:
    • Simple URL: index.php?r=site/tcpdf
    • Pretty URL: site/tcpdf
## Insert TCPDF in your extension
  • Load Component Yii2 TCPDF
    \Yii::$app->get('tcpdf');
  • Insert here your TCPDF Code
    ...
  • Close Yii2
    \Yii::$app->end();