Yiiexcel Extentsion

I’m to new write on the extension page so I have to write on the forum.

In the yiiExcel installation guide you have to register the YiiExcel autoloader on index.php


require_once($yii);

    //do not run app before register YiiExcel autoload

    $app = Yii::createWebApplication($config);

 

    Yii::import('ext.yiiexcel.YiiExcel', true);

    Yii::registerAutoloader(array('YiiExcel', 'autoload'), true);

 

    // Optional:

    //  As we always try to run the autoloader before anything else, we can use it to do a few

    //      simple checks and initialisations

    PHPExcel_Shared_ZipStreamWrapper::register();

 

    if (ini_get('mbstring.func_overload') & 2) {

        throw new Exception('Multibyte function overloading in PHP must be disabled for string functions (2).');

    }

    PHPExcel_Shared_String::buildCharacterSets();

 

    //Now you can run application

    $app->run();

I’m working on a project that uses Smarty and that code would mess up my Smarty autoloader so instead I put all that code that should register the autoloader in the action that would render the report and it works like a charm, not sure if that’s the best way to do things, but it’s a quick fix.