学习CURD遇到的问题

浏览:546 发布日期:2012/12/31 分类:求助交流
看到getField方法 于是在FormAction.class.php控制器中建立如下函数
public function title(){
$Form = M("Form");
// 获取标题
$title= $Form->where('id=3')->getField('title');

if($title) {
dump($title);
$this->title = $title;// 模板变量赋值
}else{
$this->error('数据错误');
}
$this->display();
}
在TPL/Form中建立title.html
html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
{$title.title}


</body>
</html>
在浏览器中测试 http://localhost/index.php/Form/title 只能得到一个字母 神马原因
最佳答案
评论( 相关
后面还有条评论,点击查看>>