Welcome Guest, Not a member yet? Register   Sign In
Load a class in CodeIgniter
#4

(01-03-2018, 02:40 AM)danangeloalcanar Wrote:
(01-03-2018, 02:05 AM)Paradinight Wrote:
(01-03-2018, 01: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!

Try
composer clear-cache
and/or
composer self-update --update-keys

it could be slow internet

---
you need an autoloader. :/
we should solve the composer problem.
Reply


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



Theme © iAndrew 2016 - Forum software by © MyBB