Reputation: 5755
Getting this type of error on my host,but have no errors on my localhost. The error dissapears on the host when I display the values using relation name like model.attribute
. What can be the problem?
Here is my model:
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'),
);
}
here is the view file:
<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'
),
),
)); ?>
Thanks.
Upvotes: 0
Views: 1392
Reputation: 853
I think you need to check filenames of your model classes! Because when you running your application under windows all filenames are case insensitive, but under linux based system Yii doesn't find them.
Upvotes: 2