using themes at run time

i’ve trying to activate a theme in ma project at run time. that is based on the actions in the controller?

can anyone tell me how do i go about it?

i tried something like this but it didnt work.


public function actionCreate()

	{

		$model=new Location;


		// Uncomment the following line if AJAX validation is needed

		// $this->performAjaxValidation($model);


		if(isset($_POST['Location']))

		{

			$model->attributes=$_POST['Location'];

			if($model->save())

				$this->redirect(array('view','id'=>$model->location_id));

		}


		$this->render('create',array(

			'model'=>$model,

			'theme'=>'tokyo',

		));

	}

Take a look at Themes