0

I'm trying to use dompdf with codeigniter but after adding initial code i got an error

error message

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: core_settings

Filename: theme/application.php

Line Number: 51

this is the code in my controller

function pdf_create($html, $filename='', $stream=TRUE) 
{
    require_once("dompdf/dompdf_config.inc.php");

    $dompdf = new DOMPDF();
    $dompdf->load_html($html);
    $dompdf->render();
    if ($stream) {
        $dompdf->stream($filename.".pdf");
    } else {
        return $dompdf->output();
    }
}

    function pdf()
{
     $this->load->helper(array('dompdf', 'file'));

     $html = '<h1>HELLO WORLD</h1>';
     pdf_create($html, 'filename');

}

this is the line 51 in theme/application.php

<link rel="stylesheet" href="<?=base_url()?>assets/blueline/css/bootstrap.min.css?ver=<?=$core_settings->version;?>" />
Shihas
  • 814
  • 15
  • 44

0 Answers0