E
E
EVOSandru62015-03-11 13:47:20
Yii
EVOSandru6, 2015-03-11 13:47:20

Why can't links be displayed in CDetailView in Yii?

Good afternoon,
everything works in CGridView. relation are exposed in the model:

public function relations()
  {
               ...
               'task' => array(self::BELONGS_TO, 'Task', 'TASK'),
               ...
        }

But in CDetailView, as in the example below, the output value for TASK comes out literally the line that I wrote:
$this->widget('zii.widgets.CDetailView', array(
  'data'=>$model,
  'attributes'=>array(
    'NAME',
    'TASK'=>array(
            'name'=>'TASK',
            'value'=>'$data->task->NAME',
        ),
    'STATUS',
    'USER',
    'PHOTO',
    'ORDER_SORT',
    'EXIST',
  ),
));

How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Grechushnikov, 2015-03-11
@maxyc_webber

'value'=>$model->task->NAME

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question