• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Load a class in CodeIgniter

#3
(01-03-2018, 03:05 AM)Paradinight Wrote:
(01-03-2018, 02:50 AM)danangeloalcanar Wrote: Hello Community,

I am having a problem in loading a class in CodeIgniter. Hope you can help me with this! Smile

Here is the scenario.

Before I am using Composer to load packages/classes in my project. Very helpful. Makes my life easy.

But suddenly, I cannot install packages. It shows zlib_decode data error. I don't what really happened.
I am still looking for a solution but for now, I just want to load a package in my project. 

The package is the phpoffice/phpspreadsheet.[url=https://packagist.org/packages/phpoffice/phpspreadsheet][/url]

My question is: how can I include this package/class in my project? So I can call/instantiate the Spreadsheet class.
$spreadsheet = new Spreadsheet();

I have tried putting it in application/libraries and application/third_party folder. I also have tried using require_once APPPATH . '..'


Still I cant instantiate the Spreadsheet class.

Would you guide me how to properly load a class in CodeIgniter? THANKS! Smile

Use Composer:

https://www.codeigniter.com/user_guide/g...-resources

Hi Paradinight,

As I have said on my post, I am having a problem with composer. I am still trying to fix it. But for now, is there a way to include packages without using composer? Thanks!
Reply


Messages In This Thread
Load a class in CodeIgniter - by danangeloalcanar - 01-03-2018, 02:50 AM
RE: Load a class in CodeIgniter - by Paradinight - 01-03-2018, 03:05 AM
RE: Load a class in CodeIgniter - by danangeloalcanar - 01-03-2018, 03:40 AM
RE: Load a class in CodeIgniter - by Paradinight - 01-03-2018, 04:40 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.