视图文件中出错

时间:2011-05-09 09:35:18

标签: zend-framework netbeans

我是zend framework的新手。我在尝试查看页面时遇到以下错误

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 ;?>

1 个答案:

答案 0 :(得分:1)

这是完全正确的(在我的Zend Framework安装完美,我只是不明白“以哪种方式”你使用表格...但是,无论如何,它有效,所以“bug”不存在...