phpexcel module for kohana
Latest commit ef120ec May 21, 2013 @katan Merge pull request #1 from yuankai/3.3/master
Failed to load latest commit information.
classes add support for option list Apr 9, 2013
config add PHPExcel Dec 12, 2012
vendor add PHPExcel Dec 12, 2012
.gitignore Ignore Netbeans project directory Dec 12, 2012
.gitmodules add PHPExcel Dec 12, 2012 Update Dec 12, 2012
init.php add PHPExcel Dec 12, 2012


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. 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'].',';