查看文件时出错
我是 zend 框架的新手。尝试查看页面
Fatal error: Using $this when not in object context in D:\xampp\htdocs\neemjobs\application\views\scripts\register\index.phtml on line 1
class RegisterController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$this->view->pageTitle = "Zend_Form Example";
$this->view->bodyCopy = "<p >Please fill out this form.</p>";
$form = new forms_ContactForm();
$this->view->form = $form;
}
}
“我的视图是”时出现以下错误
<?php echo $this->pageTitle ;?>
<?php echo $this->bodyCopy ;?>
I'm new to zend framework.I'm getting the following error when trying to view the page
Fatal error: Using $this when not in object context in D:\xampp\htdocs\neemjobs\application\views\scripts\register\index.phtml on line 1
class RegisterController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$this->view->pageTitle = "Zend_Form Example";
$this->view->bodyCopy = "<p >Please fill out this form.</p>";
$form = new forms_ContactForm();
$this->view->form = $form;
}
}
My View is
<?php echo $this->pageTitle ;?>
<?php echo $this->bodyCopy ;?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是完全正确的(在我的 Zend Framework 安装完美的情况下,我只是不明白您“以何种方式”使用表单...但是,无论如何,它有效,所以“错误”不存在...
This is totally correct (on my Zend Framework installation goes perfectly, I just don't understand "in which way" are you using the Form... but, anyway, it works, so the "bug" is not there...