In this post, I would like to show using of PhpSpreadsheet library within your CodeIgniter 3 project. PhpSpreadsheet is a pure PHP library for reading and writing spreadsheet files.
Here is my another post, you might be interested in – How to use PHPExcel with CodeIgniter?
Here are the steps to generate Excel in the CodeIgniter 3 application with PhpSpreadsheet:
Step 1: Download and install CodeIgniter.
Step 2: Run below composer command to download
phpspreadsheet library from your project folder. It will create a new folder called “vendor” and it will download
phpoffice/phpspreadsheet library into it.
Here is my the directory structure after installing phpoffice/phpspreadsheet
Step 3: Open
application/config/config.php file and set you vendor directory path
Step 4: Use phpspreadsheet library inside in your controller, here is the sample:
For more information, here is the official documentation page of – phpspreadsheet documentation
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.