Skip to content
phpexcel module for kohana
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


PHPExcel module for Kohana 3.2.x


Kohana framework helper class to make and read spreadsheet easier Added in this fork:

  • read spreadsheet from csv, excel5 and excel2007


Via git submodules (recommended): The PHPExcel library (version 1.7.6) is now linked as a git submodule to vendor/phpexcel relative to the phpexcel module installation folder. Clone the repository via:

git submodule add git:// modules/phpexcel
git submodule init

Then update the git submodule and the contained vendor/phpexcel sub-submodule from the repository root:

git submodule update --init --recursive

If you followed the commands exactly, all contents should have been cloned by now. Further information for git submodules within submodules on [Stackoverflow] 1. Finally load the module in your application (see below).

Via ZIP file download: Download and extract the zip file. Place the phpexcel module in modules/phpexcel. Because the git submodule in the vendor/phpexcel folder is not included in the download, please go and get it at (again, the zip download is what you want), then replace the empty vendor/phpexcel folder with it.

Finally load the module in your application as follows:

In the application/bootstrap.php add module loading

    'phpexcel'   => MODPATH.'phpexcel',


Creating a Spreadsheet

$spreadsheet = Spreadsheet::factory(array(
      'author'  => 'Kohana-PHPExcel',
      'title'      => 'Report',
      'subject' => 'Subject',
      'description'  => 'Description',
      'path' => '/',
      'name' => 'report'
$as = $spreadsheet->get_active_sheet();



$sh = array(
	1 => array('Day','User','Count','Price'),
	2 => array(1, 'John', 5, 587),
	3 => array(2, 'Den', 3, 981),
	4 => array(3, 'Anny', 1, 214)

$spreadsheet->set_data($sh, false);

Reading a Spreadsheet

$spreadsheet = Spreadsheet::factory(
                    'filename' => 'spreadsheet.xlsx'
          ), FALSE)
foreach ($spreadsheet as $v)
          echo $v['A'].',';
You can’t perform that action at this time.