I am trying to integrate TCPDF on CI4. while integrating, it throws
What I have done so far is
1) Pasted tcpdf folder in library folder
2) Created "Tpdf.php" in library folder (code below)
3) I called TCPDF in "home controller" (code below)
After that I am getting error as shown in attached image
Please suggest the solution.
What I have done so far is
1) Pasted tcpdf folder in library folder
2) Created "Tpdf.php" in library folder (code below)
Code:
<?php
namespace App\Libraries;
require_once APPPATH.'/libraries/tcpdf/tcpdf.php';
class Tpdf extends TCPDF
{
public function __construct()
{
parent::__construct();
}
}
3) I called TCPDF in "home controller" (code below)
Code:
<?php
namespace App\Controllers;
use App\Models\UserModel;
use App\Libraries\Tpdf;
class Home extends BaseController
{
public $tcpdf;
function __construct()
{
$this->userModel = new UserModel();
$this->tpdf = new Tpdf();
}
After that I am getting error as shown in attached image
Please suggest the solution.