💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
页面访问、post提交出错后异常处理 转发到固定页面 **操作页面:** ~~~ public function manageAction() { try { //正常操作 } catch (Exception $e) { $this->forward('error', 'auth', 'pzdmzzg', array( 'msg' => $e->getMessage() )); } } ~~~ **错误页面Action:** ~~~ /** * 操作出错页面 * @author guoguangyang<g_guangyang@163.com> * @version 1.0.0 * 2016年9月24日 下午4:50:41 * */ public function errorAction(){ $errorMsg = $this->_request->getParam('msg'); $this->view->errorMsg = $errorMsg; } ~~~ **错误页面view:** ~~~ <?php /** * * @abstract 用户操作出错后统一转发到此页面,接收错误信息展示 * 2016年9月24日 下午2:15:22 * @author guoguangyang<g_guangyang@163.com> * @version 1.0 */ $errorMsg = $this->errorMsg; ?> <h3>操作出错</h3> <?php if($errorMsg):?> <h4>错误信息:<b style="color: red;"><?php echo $errorMsg?></b></h4> <button class="btn btn-default" onclick="history.go(-1);">返回</button> <?php endif;?> ~~~