Widgets theming

I was trying the theming system of yii, all worked pretty well except when i tried to have different views based on theme for the same widget.

it seeks for the required view only inside the views subdirectory.

i made this change to CWidget (i tried to extend the class but couldn't because of static variables)



	public function getViewPath()


	{


		$className=get_class($this);


		if(isset(self::$_viewPaths[$className]))


			return self::$_viewPaths[$className];


		else


		{			


			if(($theme=Yii::app()->getTheme())!==null)


				return self::$_viewPaths[$className]=$theme->getBasePath().DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'views';


			else


			{


				$class=new ReflectionClass(get_class($this));


				return self::$_viewPaths[$className]=dirname($class->getFileName()).DIRECTORY_SEPARATOR.'views';


			}				


		}


	}


This, obviously isn't good, because it only works for components in the main dir and not nested dirs and doesn't load the default view without theme if the required view isn't in the theme (like CController does)

But is just to explain the idea of enabling components to be themed too

Perhaps there is already a way of doing this and i am mistaken?