そこで、Zendの最新の2.0バージョンをインストールしました。コントローラでビューを定義してから表示するのに問題があります。新しいViewModelを作成して返すと、正常に機能します。例えば。
public function __construct()
{
$this->view = new ViewModel();
}
$this->view->hello="hey";
$this->view->test="there";
return $this->view;
しかし、Zend1.8以前ではこれを行う必要はありませんでした。新しいモデルを作成しないと、次のエラーが発生します。
Strict Standards: Creating default object from empty value in /path-to-controller-file.php
別の場所に設定する必要がありますか?