mpdf - Codeigniter: Unable to locate the specified class: Exceptions.php -


here's controller:

$html = $this->load->view('print_po', $po, true); $this->load->library('pdf'); $pdf = $this->pdf->load(); 

now i've tried , comment each line , 1 shows error is:

$pdf = $this->pdf->load(); 

here's library class in application/libraries:

<?php if (!defined('basepath')) exit('no direct script access allowed');  class pdf {      function pdf()     {         $ci = & get_instance();         log_message('debug', 'mpdf class loaded.');     }      function load($param=null)     {         include_once apppath.'/third_party/mpdf/mpdf.php';          if ($params == null)         {             $param = '"en-gb-x","a4","","",10,10,10,10,6,3';         }          return new mpdf($param);     } } 

the error comes after moving code 1 server another(the error happens on centos server bet case sensitive). question here be: should modify codeigniter loads exceptions.php normally?

first, remove forward-slash @ first of /third_party phrase:

include_once apppath.'third_party/mpdf/mpdf.php'; 

codeigniter defines apppath constant trailing slash. take @ index.php:

define('apppath', $application_folder.'/'); 

second, make sure file/folder names same have wrote. it's better keep them lowercase. here related topic.

update:

the class name should capitalized. in case change pdf pdf:

class pdf {  // ... } 

from ci documentation:

naming conventions:

  • file names must capitalized. example: myclass.php
  • class declarations must capitalized. example: class myclass
  • class names , file names must match.

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -