Eeverything works fine, when i'm using main configuration file of application for customizing module components.
But i want to make module with default settings.
I tried to configure components inside DownloadModule which extends CWebModule:
<?php
public function init()
{
// this method is called when the module is being created
// you may place code here to customize the module or the application
// import the module-level models and components
$this->setImport(array(
'download.models.*',
'download.components.*',
));
$this->configure(array(
'preload'=>'log',
'components'=>
array(
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'trace, info',
'categories'=>'download',
'logFile'=>'report'
),
)
)
)));
}
?>
Controller:
<?php
class DefaultController extends CController
{
public function actionIndex()
{
Yii::log("hello",'info','download');
$this->render('index');
}
}
?>
But module keeps using components settings from main configuration file of application.
In you main config.php, did you add this to the componets
,'yourModule' => array(
'class'=>'application.components.yourModule',
I think your mean 'class'=>'application.modules.yourModule',
Anyway, i tried all variants, and nothing helps. Also, i can't understand why should i use the code that u wrote. There is nothing in documentation and cookbook about this.
'class' array element is required because of an algorythm used in YII to instantiate components and modules. Class name is never split from property values. Otherwise instrantiation wouldn't be solid.
'class' array element is required because of an algorythm used in YII to instantiate components and modules. Class name is never split from property values. Otherwise instrantiation wouldn't be solid.