在一个操作中,我需要用一些XML来响应。我使用Response::FORMAT_XML,效果很好。 // In a controller:
public static function actionFetchData() {
Yii::$app->response->format = Response::FORMAT_XML;
return [
'a' =>
我得到那些陌生的“非静态的”错误升级后编译错误,当我运行“激活编译”: non-static method <T>register(java.lang.Class<T>,play.data.format.Formatters.SimpleFormatter<T>) cannot be referenced from a static context
public MyController()