Yii正在尝试获取非对象的属性

Yii正在尝试获取非对象的属性,yii,Yii,在我的主机上获取此类型的错误,但在我的本地主机上没有错误。当我使用关系名称(如model.attribute)显示值时,该错误在主机上消失。有什么问题吗 这是我的型号: public function rules() { // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( array('ammou

在我的主机上获取此类型的错误,但在我的本地主机上没有错误。当我使用关系名称(如
model.attribute)显示值时,该错误在主机上消失。有什么问题吗

这是我的型号

public function rules()
{
    // NOTE: you should only define rules for those attributes that
    // will receive user inputs.
    return array(
        array('ammount, currency_id, operation_type', 'required'),
        array('currency_id, operation_type, client_id, organization_id', 'numerical', 'integerOnly'=>true),
        array('creation_date, modification_date, ammount, ammount_usd', 'length', 'max'=>10),
    //array('ammount, currency_id, operation_type, client_id, organization_id,comment', 'safe'),

        array('ammount, ammount_usd, currency_id, operation_type, client_id, organization_id, currency,comment,
        operationType ,client, organization', 'safe', 'on'=>'search'),
    );
}

/**
 * @return array relational rules.
 */
public function relations()
{
    // NOTE: you may need to adjust the relation name and the related
    // class name for the relations automatically generated below.
    return array(
        'client' => array(self::BELONGS_TO, 'Client', 'client_id'),
        'currency' => array(self::BELONGS_TO, 'Currencies', 'currency_id'),
        'organization' => array(self::BELONGS_TO, 'Organizations', 'organization_id'),
        'operationType' => array(self::BELONGS_TO, 'OperationType', 'operation_type'),
        'operationsMeta' => array(self::HAS_MANY, 'OperationsMeta', 'operation_id'),
    );
}
以下是视图文件:

<h1>Управление операциями</h1>

<?php $this->widget('bootstrap.widgets.BootGridView',array(
    'id'=>'operations-grid',
    'type'=>'striped bordered',
    'dataProvider'=>$model->search(),
    //'filter'=>$model,
    'columns'=>array(
        array(
            'name'=>'operationType',
            'value'=>'$data->operationType->name',
            'header'=>'Операция'
        ),
        array(
            'name'=>'creation_date',
            'type'=>'datetime',
            'header'=>'Дата создания'
        ),
        'ammount_usd:raw:Сумма',
        'comment:text:Комментарий',
        array(
            'name'=>'currency',
            'value'=>'$data->currency->short',
            'header'=>'Валюта',
        ),
        array(
            'name'=>'client',
            'value'=>'$data->client->fio',
            'header'=>'Клиент',
        ),
        array(
            'name'=>'organization',
            'value'=>'$data->organization->name',
            'header'=>'Организация',
        ),

        array(
            'class'=>'bootstrap.widgets.BootButtonColumn',
            'header'=>'Action'
        ),
    ),
)); ?>


谢谢。

我认为您需要检查模型类的文件名!因为在windows下运行应用程序时,所有文件名都不区分大小写,但在基于linux的系统下,Yii找不到这些文件名。

错误发生在哪一行?在跟踪时,发现它在$data->client->fio行失败。fio是一个虚拟字段,在客户机模型中有一个公共getter。奇怪的是,这段代码是在本地服务器上工作的,而不是在主机服务器上工作的,这表明$data->client是空的,或者没有该特定型号的记录?有来自数据库的数据。在渲染视图之前打印了$model。\r。thx作为提示,将在上午尝试并通知您。