I have created frontend-backend structre following http://www.yiiframework.com/wiki/33/ so my structure is
wwwroot/
index.php
backend.php
assets/
images/
js/
protected/
config/
main.php
components/
controllers/
models/
modules/
views/
runtime/
backend/
config/
main.php
components/
controllers/
models/
modules/
views/
runtime/
and my backend config is
$backend = dirname(dirname(__FILE__));
$frontend = dirname($backend);
yii::setPathOfAlias('backend',$backend);
return array(
'basePath' => $frontend,
'controllerPath' => $backend.'/controllers',
'viewPath' => $backend.'/views',
...
'import'=>array(
'backend.modules.rights.*',
'backend.modules.rights.components.*',
'backend.models.*',
'backend.components.*',
'application.modules.user.models.*',
'application.modules.user.components.*',
),...
Now I need to access controllers,models and views at backend from frontend like backend.php/discussion and discussion is at protected/controllers/DiscussionController which right now only accesable from index.php/discussion
One Solution is set 'controllerPath'=>$frontend.'/controllers' but now i loose backend controllers. So is there is way that when i call a controller, first it looks in backend controllers and then look in frontend controllers(in case not found in backend controllers)?