layouts between modules problem

Hi there.

I have a main app with /layouts/main.php layout and a module named ‘admin’ in it with /layouts/main.php layout file. Problem is, when Im moving from main page localhost/avd/index.php/site to main page of admin the URL become like this localhost/avd/index.php/admin and I dont see layout specified in admin module, instead I see the “old” main layout. What is the reason?..



class AdminModule extends CWebModule


	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








	public function beforeControllerAction($controller, $action)


		if(parent::beforeControllerAction($controller, $action))


			// this method is called before any module controller action is performed

			// you may place customized code here

			return true;



			return false;



DefaultController.php //admin


class DefaultController extends Controller


	public function actionIndex()








Controller.php //whole app


class Controller extends CController



	public $layout='//layouts/column1';


	public $menu=array();


	public $breadcrumbs=array();


snippet from /protected/config/main.php


'modules'=>array('admin', ...

The problem is, that your modules DefaultController extends Controller where the layout is set to

"//layouts/column1" = /protected/views/layouts/column1

// … means the applications view path

/ … means the modules view path

See documentation getLayoutFile

So try to set

public $layout='/layouts/column1'

in your admin DefaultController


see this topic for another solution.

Thanks a lot!