[已解决]请教一个Yii的failed to open stream: No such file or directory问题

您好, 我使用的环境是xampp

我创建了一个项目,

index.php的内容如下

[sup]

$yii=dirname(FILE).'/framework/yii.php';

$config=dirname(FILE).'/protected/config/main.php';

// remove the following line when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);

define('DRIVED_FILE_PATH', dirname(FILE).'DrivedFiles/');

[/sup]

我在models目录里面创建了一个CustomFeed

定义如下

class CustomFeed extends CActiveReocrd{

//消息ID


var $id;


//创建者ID


var $memberId;


//称谓


var $appellation;


//联系方式


var $contact;


//内容


var $context;


//创建日期


var $createTime;


//最后更新日期


var $updateTime;





/**


 * Returns the static model of the specified AR class.


 * @return CActiveRecord the static model class


 */


public static function model($className=__CLASS__)


{


	return parent::model($className);


}








/*


 * 配置CustomFeed模型的映射关系


 * 


 * @return CustomFeed模型映射关系


 */


public function relations(){


	return array(


		'author' => array(self::BELONGS_TO, 'Custom', 'memberId'),


	);


}





/**


  * 模型持久化前效验的前置过滤器, 这里检查是否为新记录, 记录下创建日期和最后修改日期, 此方法为模型入库时自动调用


 */


protected function beforeValidate($on)


{


	if($this->isNewRecord)


		$this->createTime=$this->updateTime=time();


	else


		$this->updateTime=time();


	return true;


}

}

当我访问action里面 调用 new CustomFeed()的时候

报failed to open stream: No such file or directory

请教

你是否拼写错了CActiveReocrd? 你的main.php是怎么样的?有没有import application.models.* ?

确实是拼错了,不好意思,呵呵

不明白你问什么问题?另外,你给出的这些log message是不同request的,没什么用。