吴旭晓个人博客 繁体中文 简体中文

首页| 日志 |JAVA |ASP |PHP |Android |IOS |ASP.NET |JavaScript |DIV+CSS |SEO |taobaoke |饼哥语录
繁体中文 简体中文

thinkphp 为什么插入的时候总是说Object not found!

我可以访问该类中的test方法,但是当我访问add()方法的时候就出现Object not found!代码如下:
<?php
class IndexAction extends Action{
public function index() {
$this->assign(‘title’,'添加数据’);//这里设置了模板变量{$title}
$this->display();
}
public function test(){
header(“Content-Type:text/html; charset=utf-8″);
echo ‘哈,访问正确!!’;
}

// 处理表单数据的方法
function add() {
$Form = D(“Form”);
if($Form->create()) {
$Form->add();
$this->redirect();
}else{
header(“Content-Type:text/html; charset=utf-8″);
exit($Form->getError().’ [ <A HREF="javascript:history.back()">返 回</A> ]‘);
}
}

}//类定义 end
//访问http://localhost/Myapp/index.php/index/test可以
//访问http://localhost/Myapp/index.php/index/add出错

?>


function add() {
$Form = D(“Form”);
if($Form->create()) {
$Form->add();
$this->redirect();
}else{
header(“Content-Type:text/html; charset=utf-8″);

作者:吴旭晓 | 来源:个人博客 | 点击量:3016 | 发布时间:2010-11-07
最新留言 | 返回上一页 | 返回首页

相关文章:

版权所有:吴旭晓个人博客 Copyright © 2013-2023 个人博客