zend framework和smarty整合,关于在模板中调用php对象
问题是这样是:我把zend framework和smarty整合到一起,我在类的代码中是这么写:$fp = new FormProcessor_UserRegistration($this->db); $this->view->fp = $fp;
在模板中是 $fp->hasError(); 程序运行时出现错误:
日志中的记载是:
[Tue Aug 03 09:53:34 2010] [error] [client 127.0.0.1] PHP Fatal error: Call to a member function hasError() on a non-object in G:\\www\\phpweb20\\data\\tmp\\templates_c\\%%EB^EB0^EB0DA243%%register.tpl.php on line 15
[Tue Aug 03 09:53:34 2010] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in G:\\www\\phpweb20\\include\\Zend\\Controller\\Dispatcher\\Standard.php:194\nStack trace:\n#0 G:\\www\\phpweb20\\include\\Zend\\Controller\\Front.php(920): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))\n#1 G:\\www\\phpweb20\\htdocs\\index.php(34): Zend_Controller_Front->dispatch()\n#2 {main}\n thrown in G:\\www\\phpweb20\\include\\Zend\\Controller\\Dispatcher\\Standard.php on line 194, referer: http://phpweb20/account/register
[Tue Aug 03 09:53:35 2010] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in G:\\www\\phpweb20\\include\\Zend\\Controller\\Dispatcher\\Standard.php:194\nStack trace:\n#0 G:\\www\\phpweb20\\include\\Zend\\Controller\\Front.php(920): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))\n#1 G:\\www\\phpweb20\\htdocs\\index.php(34): Zend_Controller_Front->dispatch()\n#2 {main}\n thrown in G:\\www\\phpweb20\\include\\Zend\\Controller\\Dispatcher\\Standard.php on line 194, referer: http://phpweb20/account/register