Modules using common layout not showing images [RESOLVED]

Hi,

I’m using modules in my project and I have set it up to use a common layout found in


ProjectName/protected/views/layout/main.php

.

The page is rendered with the layout, however the images used by the layout are missing. The images are in


 ProjectName/images/ 

Here’s how i set up the controller in my module:

"ProjectName/protected/modules/ModuleName/controllers/DefaultController.php"




class DefaultController extends CController

{

	public $layout="//layouts/main";

	public function actionIndex()

	{

		$this->render('index');

	}

}



Here’s a small snippet from the layout file trying to render an image:

"ProjectName/protected/views/layouts/main.php"




<?php echo CHtml::image('//images/logo.png','',array('style'=>'width:1.5em; height:1.5em'))?>



Did i do it correctly?

A little help for a newbie please. :)

Nevermind, i figured it out.

Changed


"//images/logo.png"

to


"/projectName/images/logo.png"

. Hope this would be helpful to others. :D

-Benjie




Yii::app()->baseUrl . '/images/logo.png'



might be even better. It makes your application fully portable.

got that. thanks!

-Benjie