コントローラーレベルでの例外処理に問題があります。基本的に、私は FOO controller 、 abcAction と言う 1 つのコントローラーと、xyz アクションを持つ別のコントローラー BOO を持っています。今、私は abc 内で xyz を呼び出す必要があり、その出力を使用する必要があります。abc では、例外をスローする他の API を呼び出しています。abc では、try catch を使用してこれらの例外を処理しており、コードは完全に実行され、その後はビューが再作成されていません。空白のページが来ています。
コード
class FooController extends Zend_Controller_Action {
function abcAction(){
//some code here
//no based on the parameters we are calling other action
$view = new Zend_View();
try{
$view->action('xyz','Boo','',$params);
}catch(Exception $e){
//handling exception
}
}
}
class BooController extends Zend_Controller_Action {
function xyzAction(){
//some code here
//calling other api where we are throwing exception if some conditions are not met and normally my error controller will handle it.
}
}
例外をスローするたびに、空白のページが表示されます。そのビュー オブジェクトを $this->_helper->actionStack() に置き換えたので、エラー コントローラー phtml と私の abcaction phtml をレンダリングしています。
これを取り除く方法は?他のアクション内でアクションを呼び出す他の方法はありますか?