hello,
i'd like to insert a link in a CGridView in order to link my posts to their authors.
i tried with this code, but had no success:
It looks like $model->id_post_author is always empty...
plus, but minor problem: this column can't be searched... why?
thanks a lot
i'd like to insert a link in a CGridView in order to link my posts to their authors.
i tried with this code, but had no success:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'posts-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
//'id_posts',
array(
'class'=>'CLinkColumn',
'label'=>'id_post_author',
'url'=>'users/view&id='.$model->id_post_author,
'header'=>'Author'
),
'date',
'content',
'title',
'excerpt',
/*
'status',
'url',
'id_cliente',
'immagine_fissa',
'immagine',
*/
array(
'class'=>'CButtonColumn',
),
),
)); ?>It looks like $model->id_post_author is always empty...
plus, but minor problem: this column can't be searched... why?
thanks a lot