Render component’s view from a theme

If you want to make your components (protected/components) themable and hold all the views in the same place, you should use path aliases.


class EditFonts extends CWidget

{

  public function run()

  {

    $this->render('application.views.edit.fonts');

  }

}

You can also use YiiBase::setPathOfAlias() to define new root path aliases.


Yii::setPathOfAlias('theme', Yii::app()->theme->basePath);

Source: http://gosaric.com/yii-framework/render-components-view-from-a-theme/ :)