Macbenach / yii2-tcpdf

Yii2 TCPDF to load TCPDF libraries in a Yii2 site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yii2 TCPDF

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 cinghie/yii2-tcpdf "dev-master"

or add

"cinghie/yii2-tcpdf": "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' => 'cinghie\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();

About

Yii2 TCPDF to load TCPDF libraries in a Yii2 site

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%Language:ApacheConf 0.0%