Different Controller Action Each Theme

if we use multi theme or we create standar application for our projects, there is problem like this :

profile controller for CLASSIC theme :




//profileController.php


class ProfileController extends CController{

  public $defaultAction = 'profile';


  public function actionProfile(){

    //show profile

  }


  public function actionEdit(){

    //edit profile

  }


  public function actionChangePassword(){

    //change Password

  }


}



profile controller for METRO theme:




//profileController.php


class ProfileController extends CController{

  public $defaultAction = 'profile';


  public function actionProfile(){

    if($_POST['editProfile']){

       //handle action editProfile

    }


    if($_POST['changePasword']){

       //handle action changePasswordForm

    }


    //show profile


  }

}



so, how the solutions, couse this is one file is profileController.php??

I never tried it but if I understood you correctly, try in each controller action method to put in its beginning something like:




Yii::app()->theme = 'customThemeName';



I think that should do it.a

ya, I was use this way :




//profileController.php


class ProfileController extends CController{

  public $defaultAction = 'profile';


  public function actionProfile(){

    if(Yii::app()->theme->name==='METRO'){

      if($_POST['editProfile']){

        //handle action editProfile

      }


      if($_POST['changePasword']){

         //handle action changePasswordForm

      }

    }

    //show profile

  }


  public function actionEdit(){

    //edit profile

  }


  public function actionChangePassword(){

    //change Password

  }

}