Php MVC框架中可捕获的致命错误

Php MVC框架中可捕获的致命错误,php,Php,我正在尝试为我的PHP脚本设置一个简单的MVC框架。 模型(“会议”): 控制器: function conference_history() { Auth::handleLogin(); $this->loadModel('conference'); $row = $this->model->getConferenceLogs(Session::get('user_pin')); $this->view->ro

我正在尝试为我的PHP脚本设置一个简单的MVC框架。 模型(“会议”):

控制器:

function conference_history() 

{        
    Auth::handleLogin();

    $this->loadModel('conference');
    $row = $this->model->getConferenceLogs(Session::get('user_pin'));
    $this->view->row = $row;
    $participant = $this->model->getParticipantLogs(Session::get('user_pin'));
    $this->view->participant = $participant;

    $this->view->render('account/conference_history');
}
视图:


我想这意味着只有一条记录?我想显示所有7条记录;我设置的查询是错误的还是我的echo语句?我想显示每个属性的所有7条记录(例如打印$this->row->date\u created)。

查看您的var\u转储,$this->row只是一个对象,不能转换为字符串。因此,您需要访问公共属性,例如:

<?php
print $this->row->date_created;
...//repeat as needed
?>

或者,如果在某种集合中有多个行对象

<?php
foreach($this->row_collection->row as $row){
    print $row->date_created;
...//blah blah blah
}

谢谢,'var_dump'显示$this->row变量包含内容。我应该使用echo“$this row['duration']”吗?这仍然会产生相同的错误。谢谢,如果$This->row有多个条目,如何打印?(例如,查询返回的两个不同会议的两个日期)好吧,我不能说您的数据的确切结构,但您可以很容易地循环它。我将编辑我的答案。谢谢,数据结构在问题中(这是全部);行集合代表什么?就像我说的,我不知道数据的确切结构,好像会有多行,所以我只是假设你已经将每行集合成某种集合:)啊,好的,我明白你的意思了。这里是交易,每个对象只获得一个同名属性,因此为了拥有7个“duration”属性,您需要7个“row”对象以上述方式循环并收集数据。
object(stdClass)[5]
  public 'date_created' => string '2013-10-29 19:20:37' (length=19)
  public 'duration' => string '00:03:42' (length=8)
  public 'RecordURL' => string '' (length=0)
  public 'conference_sid' => string '1c540158-40cf-11e3-b4cc-81e296145de2' (length=36)
<?php
print $this->row->date_created;
...//repeat as needed
?>
<?php
foreach($this->row_collection->row as $row){
    print $row->date_created;
...//blah blah blah
}