My url is : index.php?r=admin/default
Now I want get name of module admin in file config/main.php to mergeArray config ( such as: frontend.config.php, backend.config.php ).
Thanks.
My url is : index.php?r=admin/default
Now I want get name of module admin in file config/main.php to mergeArray config ( such as: frontend.config.php, backend.config.php ).
Thanks.
I’m not sure, but in the index page, you can replace this :
$config=dirname(__FILE__).'/protected/config/main.php';
with this one :
switch (strtolower(substr($_GET['r'],0,strpos($_GET['r'],'/'))))
{
case 'admin';
$config=dirname(__FILE__).'/protected/config/backend.config.php';
break;
...
}
Thanks for reply.
This is my code:
$settings = require(dirname(__FILE__).'/settings.php');
if( ( $arr = explode('/',$_GET['r']) ) && ( $arr[0] === 'admin' ) ) $settings = require(dirname(__FILE__).'/adminSettings.php');
return CMap::mergeArray(array(
...
),$settings);
But I realy dont want to use twice config, it means I want merge they.
I think that I should change value config in Controller file. Anything else?
Mb you want to merge urlManager component?