发现一个问题,不知道是什么回事。

#1 redguan

控制器有如下代码:

 
class test extends spController
{
function a1(){
  ......
  $this->results = $db->findAll($conditions, $sort, $fields, $limit);
  dump($this->results);


显示是空白,没有数据。

如果改成:
 
class test extends spController
{
function a1(){
  ......
  $results = $db->findAll($conditions, $sort, $fields, $limit);
  dump($results);


就可以正常显示。但是输入到模版后。需要赋值一次。

 
class test extends spController
{
function a1(){
  ......
  $this->results = $results;


不知道这个是正常现象,还是我的方法错误了。

2010-03-01 11:55:32

#2 jake

看这里 http://speedphp.com/bbs/thread-185-1-1.html

2010-03-01 12:49:23