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


    //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



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

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




    //Now you can run application


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.