hung5s/FlexiCORE — Issue #2: Fix FlexicCore class load config file by importing, not from main.php
Author: hung5s
Created: 2012-03-04 04:11:17+00:00
State: open

```php
public function init() {
parent::init();
//Load config file
$config = require(dirname(__FILE__).'/config/'.$this->config.'.php');
//Import core files
foreach($config['autoload'] as $path)
Yii::import($path,true);
foreach($config['imports'] as $path)
Yii::import($path);

if (isset($_GET['r']) && Yii::app()->urlManager->urlFormat == 'path')
Yii::app()->urlManager->urlFormat = 'get';
//Publish assets
$asset = dirname(__FILE__).'/../assets';
$this->AssetUrl = Yii::app()->assetManager->publish($asset, false, -1, YII_DEBUG);
$this->AssetFolder = Yii::app()->assetManager->getPublishedPath($asset);
}
```