먼저 다음 URL에서 PHPExcel을 다운로드합니다. https://github.com/PHPOffice/PHPExcel
그리고이 파일의 압축을 풀고 PHPExcel.php와 PHPExcel 폴더를 가져옵니다.
Codeigniter의 라이브러리 폴더에 넣었습니다.
PHPExcel을로드했지만이 메시지를 반환합니다.
<?php
class ExportSample extends REST_Controller{
public function __construct(){
parent::__construct();
$this->load->database();
$this->load->library('PHPExcel');
}
}
?>
오류 : 요청 된 클래스를로드 할 수 없습니다 : PHPExcel
나는 그것을 라이브러리에 넣고 라이브러리를로드한다고 생각하지만 그렇지 않을 수도 있습니다.
설정시 실수가 있습니까?
나에게 어떤 생각을 줘
최신 정보
Error message : require_once(): Failed opening required '/var/www/html/appservice/application//third_party/PHPExcel.php' (include_path='.:/usr/share/php:/usr/share/pear') in
<b>/var/www/html/appservice/application/libraries/Excel.php
나는 당신의 길이 잘못되었다고 생각합니다.
라이브러리 폴더는 다음 위치에 있어야합니다.application/third_party/PHPExcel/PHPExcel.php
당신은 하나의 라이브러리 작성해야 그 이후 excel.php
에 application/libraries/
폴더에 있습니다.
이 코드를 excel.php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once APPPATH."/third_party/PHPExcel/Classes/PHPExcel.php";
require_once APPPATH."/third_party/PHPExcel/Classes/PHPExcel/IOFactory.php";
class Excel extends PHPExcel {
public function __construct() {
parent::__construct();
}
}
그리고 컨트롤러에서 다음 코드를 사용하십시오 ExportSample.php
.
<?php
class ExportSample extends REST_Controller{
public function __construct(){
parent::__construct();
$this->load->database();
$this->load->library('Excel');
}
}
?>
나는 그것이 당신에게 효과가 있기를 바랍니다!
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다