CodeIgniter Third party class not loading

后端 未结 3 1772
生来不讨喜
生来不讨喜 2021-02-04 09:00

I am trying to implement Dashboard widget class (found here: http://harpanet.com/programming/php/codeigniter/dashboard/index#installation) but it is giving me error Unable

相关标签:
3条回答
  • 2021-02-04 09:48

    Sorry to hear you were having problems, (I've only just noticed this SO entry). Thanks to ReNiSh for his workaround, much appreciated.

    You do not however need to use the library approach to implement the 'require_once' of hDash. I have now written a walkthrough for getting hDash installed and running, which you can find here: http://harpanet.com/programming/php/codeigniter/dashboard/walkthrough

    Also, note that as of yesterday, 3rd Feb 2014, hDash has been updated to version 1.2.

    0 讨论(0)
  • 2021-02-04 09:59

    I am using PDF Parser from http://pdfparser.org/

    I create files application/libraries/pdf.php

    class Pdf
    {
        public function __construct()
        {
            require_once APPPATH."/third_party/pdfparser.php";
        }
    }
    

    Then I create file application\third_party\pdfparser.php

    if (!defined('pdfparser')) {
        define('pdfparser', dirname(__FILE__) . '/');
        require(pdfparser . 'pdfparser/autoload.php');
    }
    

    Last, I include PDF Parser Library in Directory => application\third_party\pdfparser

    0 讨论(0)
  • 2021-02-04 10:02

    You have to create a library that initialize the third party class:

    for Eg:

    --in library create a file named mydash.php --

    <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    class MyDash
    {
        public function __construct()
        {
            require_once APPPATH.'third_party/hArpanet/hDash/libraries/dash.php';
        }
    }
    

    load the library using:

    $this->load->library('mydash');
    

    then you are able to use the Dash class. Also able to load library in autoload.

    Thank you...

    0 讨论(0)
提交回复
热议问题