2013-12-12 79 views
0

我是Yii的新手,我正在關注Yii的截屏視頻教程。我在視頻上做了所有事情,但出現錯誤獲取CException錯誤

「屬性」Message.content「未定義。」

$this->message = $message->content; 

這裏是我的GreetingController.php

class GreetingController extends Controller 
{ 

    public $message = ''; 

    public function actionIndex() 
    { 
     $message = Message::model()->findByPk(3); 
     $this->message = $message->content; 
     $this->render('index', array('content'=>$this->message)); 
    } 

什麼一定是問題嗎?

回答

0

在你的表格消息中不會有一個叫做content的字段。

+0

還有id(3)=這是一條測試信息 – user3064038

+0

檢查我的更新 – Harikrishnan

+0

謝謝!!!!我認爲內容和「內容」是一樣的。抱歉 – user3064038