I have an action in a controller and it must works like a "factory widget":
public function actionRenderWidget($widget)
{
$widgetClass = 'My'.$widget.'Widget';
return $widgetClass::widget();
}
What is the correct way to implement something similar?