Ray Ray - 27 days ago 9
PHP Question

How would I use PHPExcel library in Fat-free framework?

I have a project that requires PHPExcel library(https://github.com/PHPOffice/PHPExcel) to be used with the application that I am porting to the Fat-free framework.

How would I use/reference this packages. thanks !

Answer

I recommend you use composer. That way you can just call the specific class, since autoload.php will automatically load every class you require.

<?php

require 'vendor/autoload.php';

$f3 = Base::instance();

$f3->route('GET /', function() use($f3) {
    $excel = new PHPExcel();
});

$f3->run();
Comments