私はcakephp 2.1.1を私のアプリケーション用に使用しています。私はコントローラを持っており、私はこのコントローラのファイルキャッシュを使用しています。コントローラのアクションでは、プラグインNUSOAPを使用してSOAPServiceを呼び出します。致命的なエラー:HtmlHelper.php(CakePHP)でコンストラクタを呼び出せません
私は2つのアクションを持っている:
public function get_result() {
$items = Cache::read('items','tenMinutes');
if($items){
//start block code filter items by params
...
//end
$service = new Service();
$result = $service->callService2($items);
$this->set('result',$result);
} else {
//redirect index to load ítems
$this->redirect(array('controller' =>'controllerName', 'action' => 'index'));
}
}
1.インデックス
public function index() {
$items = Cache::read('items', 'tenMinutes'); //tenMinutes is the configuration of cache
if($items){
$service = new Service();
$items = $service->callService();
Cache::write('items',$items,'tenMinutes');
}
$this->set('items',$items);
}
2. get_resultは、キャッシュの構成は次のとおりです。
Cache::config('tenMinutes', array(
'engine' => 'File', //[required]
'duration'=> '10 minutes', //[optional]
'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
'prefix' => 'cake_10_', //[optional] prefix every cache file with this string
));
私はindexアクションを呼び出すと、キャッシュに書き込みCakePHPの最初の時間があるとき、私は次のようなエラーがあります。
致命的なエラー:Cでコンストラクタを呼び出すことはできません:\ WAMP \ WWW \ myappの\ libに\ケーキ\ビュー\ Helper \ HtmlHelper.php on line 172
インデックスを2回入力すると、キャッシュは既に埋め込まれています。ボタンをクリックして2番目のアクション(get_result)に移動すると、同じエラーが表示されます。
誰かが私を助けることができますか?
おかげ