Yii 1.0:如何知道 renderPartial 是成功还是失败?

Yii 1.0: how to know whether the renderPartial is success of fail?

在Yii 1.0框架中,如何判断renderPartial是成功还是失败?假设 $information 持有一个关联数组,其中只有 运行 'detail/submitForm' 中的内容。请参阅下面的示例:

$this->renderPartial('detail/submitForm', array('information' => $information));

我想你可以将它包装在 try/catch 块中并使用标志变量,如下所示:

// flag variable to hold renderPartial's status, set to true initially
$renderSuccess = true;
try {
    $this->renderPartial('detail/submitForm', array('information' => $information));
}
catch (Exception $ex) {
    $renderSuccess = false;
}