我一直在使用Zend Framework并且暂时忍受这个问题,但是现在它太烦人了,所以我会把问题发给你.
Zend框架中存在Zend可以识别的某些问题(例如调用不存在的控制器),并将该问题发送到ErrorController.我的工作正常.
似乎有一些问题,Zend框架将失败并通过PHP显示错误,如果某个功能不存在或某事.那些我能看到并修复的东西.
有时虽然,Zend不会失败,但它也会发出一个空的回复.我会得到一个空白页面.他们的布局没有出现,没有代码,没有什么可以让我知道出了什么问题.上一次,有一个失败的require().我不得不在没有反馈的情况下手动解决这个问题.
有没有人经历过这个?您对如何显示这些错误有任何建议吗?任何帮助,将不胜感激!
我是ZF的新手,这是我的第一次测试.我正进入(状态
An error occurred
An error occurred
我的error.phtml是
<h1>An error occurred</h1>
<h2><?php echo $this->message ?></h2>
<?php if (isset($this->exception)): ?>
<h3>Exception information:</h3>
<p>
<b>Message:</b> <?php echo $this->exception->getMessage() ?>
</p>
<h3>Stack trace:</h3>
<pre><?php echo $this->exception->getTraceAsString() ?>
</pre>
<h3>Request Parameters:</h3>
<pre><?php echo $this->escape(var_export($this->request->getParams(), true)) ?>
</pre>
<?php endif ?>
这就是我在IndexAction中所拥有的
$this->view->title="My Places"; $this->view->headTitle($this->view->title); $Places=new Places(); echo "<pre>";var_dump($Places->fetchAll(null,'date_created DESC', 4)); echo "</pre>";
和我的模块文件ID
class Places extends Zend_Db_Table
{
protected $_name='places';
public function fetchLatest($count=10)
{
return $this->fetchAll(null,'date_created DESC', $count);
}
}
**编辑**
ErrorController是
<?php …